优化部分代码样式以及bug,新增app升级功能

This commit is contained in:
lemon橪
2021-05-21 16:47:26 +08:00
parent 8fe64bd3c6
commit 533375f056
16 changed files with 127 additions and 138 deletions

View File

@@ -16,9 +16,9 @@
{{ comment.content }}
</view>
<!-- 如果有图片则会循环显示评价的图片 -->
<view class="goods-imgs-view" v-if="comment.image != null && comment.image.length != 0">
<view class="img-view" v-for="(img, imgIndex) in comment.image.split(',')" :key="imgIndex">
<u-image @click.native="preview(comment.image.split(','),imgIndex)" width="160rpx" height="160rpx" :src="img"></u-image>
<view class="goods-imgs-view" v-if="comment.images != null && comment.images.length != 0">
<view class="img-view" v-for="(img, imgIndex) in comment.images.split(',')" :key="imgIndex">
<u-image @click.native="preview(comment.images.split(','),imgIndex)" width="160rpx" height="160rpx" :src="img"></u-image>
</view>
</view>
<view class="goods-name">

View File

@@ -117,7 +117,6 @@ export default {
this.form.skuId = this.order.orderItems[0].skuId;
},
methods: {
/**
* 点击评价
*/
@@ -134,17 +133,18 @@ export default {
});
commentsMemberOrder(this.form).then((res) => {
uni.hideLoading();
uni.showToast({
title: "发布评价成功",
duration: 2000,
icon: "none",
success: () => {
setTimeout(() => {
uni.navigateBack();
}, 1000);
},
});
if (res.data.success) {
uni.showToast({
title: "发布评价成功",
duration: 2000,
icon: "none",
success: () => {
setTimeout(() => {
uni.navigateBack();
}, 2000);
},
});
}
});
},

View File

@@ -54,7 +54,7 @@
<u-button ripple shape="circle" class="rebuy-btn" size="mini" v-if="order.allowOperationVO.showLogistics" @click="navigateToLogistics(order)">
查看物流
</u-button>
<u-button ripple :customStyle="{'background':$lightColor,'color':'#fff' }" shape="circle" class="pay-btn" size="mini" v-if="order.allowOperationVO.rog" @click="onRog(order.sn)">
<u-button ripple :customStyle="{'background':lightColor,'color':'#fff' }" shape="circle" class="pay-btn" size="mini" v-if="order.allowOperationVO.rog" @click="onRog(order.sn)">
确认收货
</u-button>
<u-button ripple shape="circle" class="rebuy-btn" size="mini" v-if="
@@ -83,7 +83,7 @@
<u-radio-group v-model="reason">
<view class="value">
<view class="radio-view" :key="index" v-for="(item, index) in cancelList">
<u-radio :active-color="$lightColor" label-size="25" shape="circle" :name="item.reason" @change="reasonChange">{{ item.reason }}</u-radio>
<u-radio :active-color="lightColor" label-size="25" shape="circle" :name="item.reason" @change="reasonChange">{{ item.reason }}</u-radio>
</view>
</view>
</u-radio-group>
@@ -94,7 +94,7 @@
</view>
</u-popup>
<u-toast ref="uToast" />
<u-modal v-model="rogShow" :show-cancel-button="true" :content="'是否确认收货?'" @confirm="confirmRog"></u-modal>
<u-modal :confirm-color="lightColor" v-model="rogShow" :show-cancel-button="true" :content="'是否确认收货?'" @confirm="confirmRog"></u-modal>
</view>
</template>
@@ -111,6 +111,7 @@ export default {
},
data() {
return {
lightColor:this.$lightColor,
tabCurrentIndex: 0, //导航栏索引
navList: [
//导航栏list
@@ -492,7 +493,7 @@ page,
}
.swiper-box {
height: calc(100% - 40px);
height: calc(100vh - 40px);
}
.list-scroll-content {

View File

@@ -37,7 +37,7 @@
<div class="content">{{ item.content }}</div>
<view class="img">
<!-- 循环出用户评价的图片 -->
<u-image width="140rpx" height="140rpx" v-if="item.image" v-for="(img, i) in splitImg(item.image)" :src="img" :key="i" @click="preview(splitImg(item.image), i)">
<u-image width="140rpx" height="140rpx" v-if="item.images" v-for="(img, i) in splitImg(item.images)" :src="img" :key="i" @click="preview(splitImg(item.images), i)">
</u-image>
</view>
<view class="bot">

View File

@@ -223,7 +223,12 @@
<script>
/************接口API***************/
import { getGoods, getGoodsList, getMpScene } from "@/api/goods.js";
import {
getGoods,
getGoodsList,
getMpScene,
getGoodsDistribution,
} from "@/api/goods.js";
import * as API_trade from "@/api/trade.js";
import * as API_Members from "@/api/members.js";
import * as API_store from "@/api/store.js";
@@ -350,7 +355,7 @@ export default {
if (val) {
let timer = setInterval(() => {
this.$refs.popupGoods.buyType = "PINTUAN";
clearInterval(timer);
}, 100);
@@ -393,7 +398,8 @@ export default {
},
async onLoad(options) {
this.routerVal = options;
},
async onShow() {
this.goodsDetail = {};
//如果有参数ids说明事分销短连接需要获取参数
if (this.routerVal.scene) {
@@ -407,11 +413,11 @@ export default {
this.init(
this.routerVal.id,
this.routerVal.goodsId,
this.routerVal.distributionId
this.routerVal.distributionId,
this.routerVal.whetherPoint
);
}
},
onShow() {},
methods: {
// 循环出当前促销是否为空
emptyPromotion() {
@@ -432,8 +438,16 @@ export default {
title: "加载中",
mask: true,
});
let response = await getGoods(id, goodsId, distributionId);
let response = await getGoods(id, goodsId);
// 这里是绑定分销员
if (distributionId || this.$store.state.distributionId) {
let disResult = await getGoodsDistribution(distributionId);
if (!disResult.data.success || disResult.statusCode == 403) {
this.$store.state.distributionId = distributionId;
}
}
uni.hideLoading();
/**商品信息以及规格信息存储 */
this.goodsDetail = response.data.result.data;
@@ -539,16 +553,13 @@ export default {
* 返回
*/
back() {
if(getCurrentPages().length ==1){
if (getCurrentPages().length == 1) {
uni.switchTab({
url: '/pages/tabbar/home/index'
url: "/pages/tabbar/home/index",
});
} else {
uni.navigateBack();
}
else{
uni.navigateBack();
}
},
/**

View File

@@ -17,11 +17,11 @@
<view class="store-line">
<u-checkbox-group class="store-line-check">
<!-- #ifndef MP-WEIXIN -->
<u-checkbox shape="circle" :active-color="$lightColor" v-model="item.checked" @change="checkboxChangeDP(item)"></u-checkbox>
<u-checkbox shape="circle" :active-color="lightColor" v-model="item.checked" @change="checkboxChangeDP(item)"></u-checkbox>
<!-- #endif -->
<!-- 微信小程序这里 v-model出现问题改用:value -->
<!-- #ifdef MP-WEIXIN -->
<u-checkbox shape="circle" :active-color="$lightColor" :value="item.checked" @change="checkboxChangeDP(item)"></u-checkbox>
<u-checkbox shape="circle" :active-color="lightColor" :value="item.checked" @change="checkboxChangeDP(item)"></u-checkbox>
<!-- #endif -->
</u-checkbox-group>
<span class="storeName store-line-desc" @click.stop="navigateToStore(item)">{{
@@ -49,11 +49,11 @@
<view>
<u-checkbox-group v-if="skuItem.invalid == 0">
<!-- #ifndef MP-WEIXIN -->
<u-checkbox shape="circle" :active-color="$lightColor" class="c-left" v-model="skuItem.checked" @change="checkboxChange(skuItem)"></u-checkbox>
<u-checkbox shape="circle" :active-color="lightColor" class="c-left" v-model="skuItem.checked" @change="checkboxChange(skuItem)"></u-checkbox>
<!-- #endif -->
<!-- 微信小程序这里 v-model出现问题改用:value -->
<!-- #ifdef MP-WEIXIN -->
<u-checkbox shape="circle" :active-color="$lightColor" class="c-left" :value="skuItem.checked" @change="checkboxChange(skuItem)"></u-checkbox>
<u-checkbox shape="circle" :active-color="lightColor" class="c-left" :value="skuItem.checked" @change="checkboxChange(skuItem)"></u-checkbox>
<!-- #endif -->
</u-checkbox-group>
<span class="invalid" v-else style="font-size: 24rpx">失效</span>
@@ -110,7 +110,7 @@
<!-- 结账 -->
<div class="box box6">
<view class="navL">
<u-checkbox shape="circle" :active-color="$lightColor" v-model="checkout" @change="checkOut()" label-size="24">全选</u-checkbox>
<u-checkbox shape="circle" :active-color="lightColor" v-model="checkout" @change="checkOut()" label-size="24">全选</u-checkbox>
<span class="price">
<div class="prices">
<div class="fullPrice">