Merge pull request 'upgrade 8.6' (#126) from zhy into master

Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/126
This commit is contained in:
hansu 2020-08-06 17:53:11 +08:00
commit c56743765c
17 changed files with 183 additions and 76 deletions

View File

@ -259,12 +259,13 @@ export default {
return vm.$u.post('Order/buyer_cancel', params);
},
// add_refund
refundOrder({ order_id, goods_id, refund_amount, refund_type = 1 } = {}) {
refundOrder({ order_id, goods_id, goods_num, reason_info, refund_amount } = {}) {
return vm.$u.post('order/add_refund', {
order_id: order_id,
goods_id: goods_id,
refund_amount: refund_amount,
refund_type: refund_type,
goods_num: goods_num,
reason_info: reason_info,
});
},
// 删除订单

View File

@ -36,7 +36,7 @@ const install = (Vue, vm) => {
} else {
// 如果返回false则会调用Promise的reject回调
// 并将进入this.$u.post(url).then().catch(res=>{})的catch回调中res为服务端的返回值
return false;
return res;
}
}

View File

@ -25,7 +25,7 @@
</view>
</view>
<view class="order-btn" v-if="[1, 2, 3, 4, 8].indexOf(order.view_type) >= 0">
<view class="cancel" v-if="order.view_type == 3 || order.view_type == 2" @click="toOtherPage('RefundOrder')">申请退款</view>
<view class="cancel" v-if="(order.view_type == 3 || order.view_type == 2) && order.is_refund == 1" @click="toOtherPage('RefundOrder')">申请退款</view>
<view class="cancel" v-if="order.view_type == 3" @click="toOtherPage('Logistics')">查看物流</view>
<view class="logistics" v-if="order.view_type == 3" @click="confirmReceive">确认收货</view>
<view class="comment" v-if="order.view_type == 4" @click="toOtherPage('Comment')">立即评价</view>
@ -47,7 +47,7 @@ export default {
props: {
order: Object
},
created() {
mounted() {
this.viewState();
},
methods: {
@ -81,6 +81,7 @@ export default {
default:
break;
}
// console.log(state);
this.state = state;
},
cancelOrder() {

View File

@ -10,7 +10,7 @@
<view class="label">
<u-tabs-swiper ref="group" :list="classifyList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="current" font-size="24" :show-bar="false" @change="tabsChange" height="60"></u-tabs-swiper>
</view>
<swiper :current="swiperCurrent" @animationfinish="animationfinish" style="height: 260rpx">
<swiper :current="swiperCurrent" @animationfinish="animationfinish" style="height: 340rpx">
<swiper-item class="swiper-item list" v-for="(_, i) in classifyList" :key="i">
<!-- 最多显示3个 -->
<sitem :info="info" v-for="(info, index) in groupList.slice(0, 3)" :key="index"></sitem>

View File

@ -36,6 +36,7 @@
box-sizing: border-box;
border-radius: 6rpx;
margin-right: 26rpx;
margin-bottom: 20rpx;
}
.xuanzhong{
border: #ff780f 1rpx solid;

View File

@ -22,10 +22,17 @@
<text class="store-name">{{ goodsInfo.store_name }}</text>
<text class="goods-name">{{ goodsInfo.goods_name }}</text>
</view>
<view class="pic">
<view class="price-collect">
<view class="pic" v-if="type != 3">
<text>{{ goodsInfo.goods_price }}</text>
<s>{{ goodsInfo.goods_marketprice }}</s>
</view>
<view class="collect">
<u-icon name="star" color="#474747" size="28" v-if="1"></u-icon>
<u-icon name="star-fill" color="#FF7807" size="28" v-else></u-icon>
<text>收藏</text>
</view>
</view>
</view>
<view class="hr"></view>
<!-- <navs :value="领券"></navs> -->
@ -135,11 +142,11 @@
</u-popup>
<!-- 普通商品 tool -->
<view class="tloos" v-if="type == 1">
<view class="navs" @click="toOthersPage('pageC/merchant/index?id=' + storeInfo.store_id)">
<view class="navs" @click="toOthersPage('pageC/merchant/index?id=' + storeInfo.store_id)" v-if="!showSpec">
<image src="/static/image/common/18.png"></image>
店铺
</view>
<view class="navs" style="margin-right:30rpx">
<view class="navs" style="margin-right:30rpx" v-if="!showSpec">
<image src="/static/image/common/19.png"></image>
客服
</view>
@ -154,7 +161,7 @@
</view>
<!-- 秒杀 tool -->
<view class="spike-tool" v-if="type==3">
<view class="left">
<view class="left" v-if="!showSpec">
<view @click="toOthersPage('pageC/merchant/index?id=' + storeInfo.store_id)">
<image src="/static/image/common/18.png"></image>
<text>店铺</text>
@ -222,7 +229,6 @@ export default {
// console.log(option);
this.type = Number(option.type);
this.id = option.id;
this.getGoodsDetails(this.id);
this.setTitle();
},
onShow() {
@ -230,6 +236,7 @@ export default {
this.showSpec = false;
this.showGroupUser = false;
this.showInvolvementUser = false;
this.getGoodsDetails(this.id);
},
onNavigationBarButtonTap(e) {
if(e.index == 0) this.$u.route('/pageC/cart/index');
@ -331,6 +338,7 @@ export default {
this.glist = res.data.data.spec_list;
this.user_suc = res.data.data.user_suc;
this.groupUser =res.data.data.user;
console.log(this.groupUser);
}
})
},
@ -372,13 +380,14 @@ export default {
}
if(this.type == 2) {
if(type == 'involvement') {
// const userId = uni.getStorageSync('user_info').member.member_id;
this.$store.commit('setGroupHeadId', this.involvemenGroupInfo[0].user_id);
console.log(this.$store.state.pintuangroup_headid);
Object.assign(params, {
pintuan_id: this.id,
pintuangroup_id: this.involvemenGroupInfo[0].pintuangroup_id,
})
} else {
const userId = uni.getStorageSync('user_info').member.member_id;
this.$store.commit('setGroupHeadId', userId);
Object.assign(params, {
pintuan_id: this.id,
})
@ -552,6 +561,10 @@ export default {
line-height: 1.5;
}
}
.price-collect {
display: flex;
align-items: center;
justify-content: space-between;
.pic{
>text{
font-size: 32rpx;
@ -564,6 +577,15 @@ export default {
margin-left: 30rpx;
}
}
.collect {
margin-left: auto;
display: flex;
align-items: center;
> text {
margin-left: 12rpx;
}
}
}
}
.comment {
margin-top: 20rpx;

View File

@ -179,12 +179,13 @@ export default {
let params = {
pintuan_id: this.orderInfo.pintuan_id,
}
// console.log(this.involvemenGroupInfo);
// console.log(this.orderInfo);
// console.log(this.$store.state.pintuangroup_headid);
if(this.orderInfo.pintuangroup_id) {
Object.assign(params, { pintuangroup_headid: this.$store.state.pintuangroup_headid });
Object.assign(params, { pintuangroup_id: this.orderInfo.pintuangroup_id });
}
// console.log(params);
console.log(params);
this.$u.api.withImmediate(params).then(res => {
this.showGroupUser = false;
this.showInvolvementUser = false;
@ -200,7 +201,6 @@ export default {
if(!this.debounce) return;
this.debounce = false;
if(this.orderType == 2) {
// this.sendOrder(0);
this.withImmediate();
} else if(this.orderType == 1) {
this.sendOrder(0);
@ -256,7 +256,6 @@ export default {
// console.log(params);
this.$u.api.sendOrder(params).then(res => {
if(res.errCode == 0) {
// this.withImmediate();
this.$u.route({
type: 'redirect',
url: '/pageC/cart/cashier',

View File

@ -4,7 +4,7 @@
<view v-for="(store, s_index) in list" :key="s_index" class="cart-item">
<view class="store">
<u-checkbox v-model="store.checked" shape="circle" active-color="#FF780F" icon-size="35" :name="s_index" @change="storeaAloneChange"></u-checkbox>
<view class="name">
<view class="name" @click="viewStoreDetails(store.store_id)">
<image :src="store.store_avatar"></image>
<view>{{ store.store_name }}</view>
</view>
@ -12,9 +12,9 @@
<view class="goods">
<u-checkbox-group @change="goodsChange($event, s_index)">
<view v-for="(goods, g_index) in store.goods" :key="g_index" class="goods-item">
<u-checkbox v-model="goods.checked" shape="circle" active-color="#FF780F" icon-size="35" :name="g_index" ></u-checkbox>
<image :src="goods.goods_image"></image>
<view class="info">
<u-checkbox v-model="goods.checked" shape="circle" active-color="#FF780F" icon-size="35" :name="g_index"></u-checkbox>
<image :src="goods.goods_image" @click="viewGoodsDetails(goods.goods_id)"></image>
<view class="info" @click="viewGoodsDetails(goods.goods_id)">
<view class="name u-line-2">{{ goods.goods_name }}</view>
<view class="cart-info">
<view class="price">{{ goods.goods_price }}</view>
@ -204,6 +204,23 @@ export default {
})
this.list[value[1]].checked = checked;
this.storeChange();
},
viewStoreDetails(sid) {
this.$u.route({
url: 'pageC/merchant/index',
params: {
id: sid
}
})
},
viewGoodsDetails(gid) {
this.$u.route({
url: 'pageB/sdetails/index',
params: {
id: gid,
type: 1,
}
})
}
},
onNavigationBarButtonTap(btn) {

View File

@ -1,6 +1,6 @@
<template>
<view class="imageTop">
<image :src="url"></image>
<image :src="url" mode="aspectFit"></image>
</view>
</template>
<style lang="scss" scoped>

View File

@ -1,7 +1,7 @@
<template>
<view class="listItem">
<video v-if="type == '2'" :src="url" :show-fullscreen-btn="true"></video>
<image v-else :src="url"></image>
<image v-else :src="url" mode="aspectFit"></image>
</view>
</template>
<style lang="scss" scoped>

View File

@ -14,7 +14,7 @@
</view>
<scroll-view scroll-y class="scroll-container" :style="{ height: scrollHeight }" @scrolltolower="loadMore">
<view class="goods-container">
<view v-for="goods in goodsList" :key="goods.goods_id" class="goods-view" @click="toDetailsPage(goods.goods_id)">
<view v-for="(goods, index) in goodsList" :key="index" class="goods-view" @click="toDetailsPage(goods.goods_id)">
<goodsItem :info="goods"></goodsItem>
</view>
</view>

View File

@ -37,19 +37,16 @@
</scroll-view>
</view>
<view class="main">
<view class="video-image" v-if="cur==0 && indextop.length">
<scroll-view class="video-image" scroll-y v-if="cur==0 && indextop.length" :style="{ height: scrollHeiht }">
<view v-for="item in indextop" :key="item.id">
<videoTop :url="item.url" v-if="item.type == 2"></videoTop>
<imageTop v-else :url="item.url"></imageTop>
<videoTop :url="item.article_pic" v-if="item.type == 2"></videoTop>
<imageTop v-else :url="item.article_pic"></imageTop>
</view>
<view style="display: flex;flex-wrap: wrap;" v-if="indexlist.length">
<listitem :style="{'margin-left': index%2 == 1 ? '20rpx':'0'}" v-for="(item,index) in indexlist" :key="item.id" :type="item.type" :url="item.url"></listitem>
<listitem :style="{'margin-left': index%2 == 1 ? '20rpx':'0'}" v-for="(item,index) in indexlist" :key="item.id" :type="item.type" :url="item.article_pic"></listitem>
</view>
</view>
<!-- 商品筛选排序未完成 -->
</scroll-view>
<view class="item" v-if="cur==1">
<!-- <item v-for="item in list" :key="item.gc_id" :info="item" class="item"></item> -->
<goods :sid="sid"></goods>
</view>
</view>
@ -87,10 +84,12 @@ export default {
sid: '',
show: false,
cur: 0,
list:[],
indexlist:[],
indextop:[],
info:{}
list: [],
indexlist: [],
indextop: [],
info: {},
page: 0,
scrollHeiht: '',
}
},
components:{
@ -101,7 +100,8 @@ export default {
},
onPullDownRefresh() {
this.getStoreInfo();
this.getStoreImgVideoList();
this.getArticlelist();
// this.getStoreImgVideoList();
},
onNavigationBarButtonTap(e) {
// console.log(e.index);
@ -114,7 +114,7 @@ export default {
if(current == 0) {
this.$u.route('/pageC/merchant/storeClassify', { id: this.sid });
} else if(current == 2) {
this.$u.route('./details', { id: this.sid });
this.$u.route('/pageC/merchant/details', { id: this.sid });
}
},
getStoreInfo() {
@ -140,12 +140,38 @@ export default {
this.$u.toast(res.message);
})
},
getArticlelist() {
this.$u.api.getArticlelist({
page: this.page,
is_video_img: 0,
store_id: this.sid,
}).then(res => {
uni.stopPullDownRefresh();
if (res.errCode == 0) {
// this.articleList = res.data.list;
if(res.data.list.length > 0) {
this.indextop = [res.data.list[0]]
this.indextop = [res.data.list[0], res.data.list[1]];
}
if(res.data.list.length > 1) {
this.indextop.push(res.data.list[1]);
this.indexlist.push(...res.data.list.slice(2,));
}
}
})
},
setViewHeight() {
const res = uni.getSystemInfoSync();
this.scrollHeiht = res.windowHeight - (73 + 20 + 170) + 'px';
}
},
onLoad(option){
this.sid = option.id;
console.log(this.sid);
// console.log(this.sid);
this.getStoreInfo();
this.getStoreImgVideoList();
this.getArticlelist();
this.setViewHeight();
// this.getStoreImgVideoList();
}
};
</script>

View File

@ -29,6 +29,7 @@
</view>
<view class="edit-tips">注意修改手机号需要原手机号获取验证码无原手机验证码请联系客服</view>
<view class="edit-btn" @click="updateMemberInfo">完成</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
@ -155,8 +156,11 @@ export default {
birthday: this.birthday,
}).then(res => {
if (res.errCode == 0) {
this.getUserInfo();
// this.$u.toast(res.message);
// this.getUserInfo();
this.$refs.uToast.show({
title: res.message,
back: true,
})
}
})
},

View File

@ -68,7 +68,7 @@
</view>
</view>
<view class="btn" v-if="['1', '2', '4', '6'].indexOf(orderstate) >= 0">
<view class="cancel" v-if="orderstate == '4' || orderstate == '1'" @click="toOtherPage('RefundOrder')">申请退款</view>
<view class="cancel" v-if="(orderstate == '4' || orderstate == '1') && orderInfo.is_refund == 1" @click="toOtherPage('RefundOrder')">申请退款</view>
<view class="cancel" v-if="orderstate == '1'" @click="toOtherPage('Logistics')">查看物流</view>
<view class="logistics" v-if="orderstate == '1'" @click="confirmReceive">确认收货</view>
<view class="comment" v-if="orderstate == '2'" @click="toOtherPage('Comment')">立即评价</view>

View File

@ -134,7 +134,7 @@ export default {
if(load == 'reload') this.orderList = res.data;
else if(load == 'loadmore') this.orderList.push(...res.data);
}
return res;
return res.data.length;
},
//
async getAfterSaleList({ load = 'loadmore' } = {}) {
@ -146,7 +146,7 @@ export default {
if(load == 'reload') this.orderList = res.data;
else if(load == 'loadmore') this.orderList.push(...res.data);
}
return res;
return res.data.length;
},
// 穿
async goodsTryOrderList({ load = 'loadmore' } = {}) {
@ -159,7 +159,7 @@ export default {
if(load == 'reload') this.orderList = res.data.list;
else if(load == 'loadmore') this.orderList.push(...res.data.list);
}
return res;
return res.data.list.length;
},
reachBottom() {
// 15
@ -173,9 +173,9 @@ export default {
// else
if(this.current == 4) promise = this.goodsTryOrderList();
else promise = this.getOrderList();
promise.then(res => {
promise.then(length => {
this.loadStatus.splice(this.current, 1, "nomore");
if(res.data.length == 0) this.page--;
if(length == 0) this.page--;
}).catch(() => {
this.loadStatus.splice(this.current, 1, "nomore");
this.page--;

View File

@ -31,22 +31,24 @@
<view class="refund-price">
<view class="price">
<view class="title">退款金额</view>
<view class="value">{{ (goods.goods_pay_price * num).toFixed(2) }}</view>
<view class="value">{{ totalPrice }}</view>
</view>
<view class="tips">若退款成功将退还给您 {{ (goods.goods_pay_price * num).toFixed(2) }}</view>
<view class="tips">若退款成功将退还给您 {{ totalPrice }}</view>
</view>
<view class="refund-text">
<view class="title">申请说明</view>
<u-input v-model="refundText" type="textarea" placeholder="必填,请详细说明退款理由" />
</view>
</view>
<view class="submit-btn">提交申请</view>
<view class="submit-btn" @click="applyRefund">提交申请</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
export default {
data() {
return {
oid: '',
goodsList: [],
goods: {
goods_num: 0,
@ -57,7 +59,13 @@ export default {
num: 0,
}
},
computed: {
totalPrice() {
return (this.goods.goods_pay_price * this.num).toFixed(2);
}
},
onLoad(option) {
this.oid = option.oid;
this.getOrderInfo(option.oid);
},
methods: {
@ -81,16 +89,41 @@ export default {
// uni.stopPullDownRefresh(); //
})
},
verifyParams() {
if(!this.goods.goods_id) {
this.$u.toast('请选择退款商品');
return false;
}
if(this.num == 0) {
this.$u.toast('请选择退款数量');
return false;
}
if(this.$u.test.isEmpty(this.refundText)) {
this.$u.toast('退款说明不可为空');
return false;
}
return true;
},
applyRefund() {
if(!this.verifyParams()) return false;
let params = {
order_id: this.order.order_id,
// goods_id: goods_id,
// refund_amount: refund_amount,
order_id: this.oid,
goods_id: this.goods.goods_id,
refund_amount: Number(this.totalPrice),
reason_info: this.refundText,
goods_num: this.num,
}
this.$u.api.refundOrder(params).then(res => {
this.$u.toast(res.message);
if(res.errCode == 0) {
this.$refs.uToast.show({
title: res.message,
back: true,
})
} else {
this.$refs.uToast.show({
title: res.message,
type: 'error'
})
}
})
},

View File

@ -158,7 +158,7 @@
<view class="order-popup">
<view class="check">
<text>选择订单</text>
<u-icon name="close" color="#A29FA3" size="32"></u-icon>
<u-icon name="close" color="#A29FA3" size="32" @click="showPopup=false"></u-icon>
</view>
<scroll-view scroll-y class="order-list">
<u-radio-group v-model="value" @change="radioChange">
@ -271,7 +271,7 @@ export default {
})
},
confirmType(e) {
console.log(e);
// console.log(e);
this.type = e[0];
},
async getOrderList({ load = 'reload' } = {}) {
@ -424,6 +424,12 @@ export default {
})
},
animationfinish(e) {
this.goodsStatus = '';
this.type = {};
this.name = '';
this.phone = '';
this.area = '';
this.address = '';
//
this.debounce = true;
let current = e.detail.current;
@ -443,9 +449,6 @@ export default {
this.choose = false;
}
},
close(){
this.showPopup = false
},
showToast(message, type) {
this.$refs.uToast.show({
title: message,