Browse Source

售后部分测试改动

zyh
Aaron 3 years ago
parent
commit
41cffec39f
  1. 3
      api/user.js
  2. 2
      pages.json
  3. 3
      pages/activity/Poster/index.vue
  4. 7
      pages/authorization/index.vue
  5. 75
      pages/home/index.vue
  6. 106
      pages/order/GoodsReturn/index.vue
  7. 39
      pages/order/GoodsReturn/productlist.vue
  8. 27
      pages/order/OrderDetails/index.vue
  9. 381
      pages/user/Login/login.vue
  10. 1
      pages/user/User/index.vue
  11. 2
      utils/index.js
  12. 4
      utils/request.js

3
api/user.js

@ -407,7 +407,8 @@ export function wxappBindingPhone(data) {
* 小程序上传用户头像
*/
export function wxappGetUserInfo (data) {
return request.post('/wxapp/loginAuth', data)
// return request.post('/wxapp/loginAuth', data)
return request.get('/wechat/auth', data)
}
/*

2
pages.json

@ -318,7 +318,7 @@
{
"path": "pages/order/ReturnList/index",
"style": {
"navigationBarTitleText": "退货列表"
"navigationBarTitleText": "我的售后"
}
},
{

3
pages/activity/Poster/index.vue

@ -29,8 +29,7 @@
return {
status: true,
id: 0,
image: "",
img: 'https://img-blog.csdnimg.cn/20190626120443986.png'
image: ""
};
},
mounted () {

7
pages/authorization/index.vue

@ -11,6 +11,8 @@
class="cu-btn author-btn"
open-type="getPhoneNumber"
@getphonenumber="phoneLogin">微信手机号一键登录</button>
<!-- <button class="cu-btn author-btn" v-if="canIUseGetUserProfile" @tap="getUserInfoProfile">授权并查看</button>
<button class="cu-btn author-btn" v-else @getuserinfo="getUserInfoBtn" open-type="getUserInfo">授权并查看</button> -->
<button class="cu-btn close-btn" @tap="back">暂不登录</button>
</view>
</view>
@ -35,11 +37,14 @@ import dayjs from 'dayjs'
import cookie from '@/utils/store/cookie'
import store from '@/store'
//
import { auth } from '@/libs/wechat.js'
export default {
data() {
return {
authorize: false,
canIUseGetUserProfile: false,
canIUseGetUserProfile: false
}
},
computed: {

75
pages/home/index.vue

@ -315,43 +315,44 @@ export default {
startQr: function() {
uni.scanCode({
success: res => {
let option = handleUrlParam(res.result)
switch (option.pageType) {
case 'good':
//
this.$yrouter.push({
path: '/pages/shop/GoodsCon/index',
query: {
q: res.result,
},
})
break
case 'group':
//
this.$yrouter.push({
path: '/pages/activity/GroupRule/index',
query: {
q: res.result,
},
})
break
case 'dargain':
//
this.$yrouter.push({
path: '/pages/activity/DargainDetails/index',
query: {
q: res.result,
},
})
break
default:
//
this.$yrouter.push({
path: '/pages/Loading/index',
query: {},
})
break
}
let option = handleUrlParam(res.result)
console.log(option)
switch (option.pageType) {
case 'good':
//
this.$yrouter.push({
path: '/pages/shop/GoodsCon/index',
query: {
q: res.result,
},
})
break
case 'group':
//
this.$yrouter.push({
path: '/pages/activity/GroupRule/index',
query: {
q: res.result,
},
})
break
case 'dargain':
//
this.$yrouter.push({
path: '/pages/activity/DargainDetails/index',
query: {
q: res.result,
},
})
break
default:
//
this.$yrouter.push({
path: '/pages/Loading/index',
query: {},
})
break
}
},
})
},

106
pages/order/GoodsReturn/index.vue

@ -1,45 +1,75 @@
<template>
<view class="apply-return">
<view class="goodsStyle acea-row row-between" v-for="cart in orderInfo.cartInfo" :key="cart.id">
<view class="pictrue">
<image :src="cart.productInfo.image" class="image" />
<!-- 售后提交 -->
<view class="container" v-if="selected">
<view class="goodsStyle acea-row row-between"
v-for="cart in orderInfo.cartInfo"
:key="cart.id"
>
<view class="pictrue">
<image :src="cart.productInfo.image" class="image" />
</view>
<view class="text acea-row row-between">
<view class="name line2">{{ cart.productInfo.storeName }}</view>
<view class="money">
<view>
{{
cart.productInfo.attrInfo
? cart.productInfo.attrInfo.price
: cart.productInfo.price
}}
</view>
<view class="num">x{{ cart.cartNum }}</view>
</view>
</view>
</view>
<view class="text acea-row row-between">
<view class="name line2">{{ cart.productInfo.storeName }}</view>
<view class="money">
<view>
{{
cart.productInfo.attrInfo
? cart.productInfo.attrInfo.price
: cart.productInfo.price
}}
<view class="list">
<view class="item acea-row row-between-wrapper">
<view>退货件数</view>
<view class="num">{{ orderInfo.totalNum }}</view>
</view>
<view class="item acea-row row-between-wrapper">
<view>退款金额</view>
<view class="num">{{ orderInfo.payPrice }}</view>
</view>
<picker :value="reason" :range="reasonList" @change="changeReason">
<view class="item acea-row row-between-wrapper">
<view>退款原因</view>
<view class="num">{{reason}}</view>
<text class="iconfont icon-jiantou"></text>
</view>
<view class="num">x{{ cart.cartNum }}</view>
</picker>
<view class="item textarea acea-row row-between">
<view>备注说明</view>
<textarea placeholder="填写备注信息,100字以内" class="num" v-model="refund_reason_wap_explain"></textarea>
</view>
</view>
<view class="returnBnt bg-color-red" @click="submit">申请退款</view>
</view>
<view class="list">
<view class="item acea-row row-between-wrapper">
<view>退货件数</view>
<view class="num">{{ orderInfo.totalNum }}</view>
</view>
<view class="item acea-row row-between-wrapper">
<view>退款金额</view>
<view class="num">{{ orderInfo.payPrice }}</view>
</view>
<picker :value="reason" :range="reasonList" @change="changeReason">
<view class="item acea-row row-between-wrapper">
<view>退款原因</view>
<view class="num">{{reason}}</view>
<text class="iconfont icon-jiantou"></text>
<!-- 选择商品 -->
<view class="selectProduct">
<view class="goodsStyle acea-row row-between"
v-for="cart in orderInfo.cartInfo"
:key="cart.id"
>
<view class="pictrue">
<image :src="cart.productInfo.image" class="image" />
</view>
<view class="text acea-row row-between">
<view class="name line2">{{ cart.productInfo.storeName }}</view>
<view class="money">
<view>
{{
cart.productInfo.attrInfo
? cart.productInfo.attrInfo.price
: cart.productInfo.price
}}
</view>
<view class="num">x{{ cart.cartNum }}</view>
</view>
</view>
</picker>
<view class="item textarea acea-row row-between">
<view>备注说明</view>
<textarea placeholder="填写备注信息,100字以内" class="num" v-model="refund_reason_wap_explain"></textarea>
</view>
</view>
<view class="returnBnt bg-color-red" @click="submit">申请退款</view>
</view>
</template>
@ -68,13 +98,20 @@
Authorization: "Bearer " + this.$store.state.token
},
id: 0,
selected: true,
orderInfo: {},
rebackList: [],
reasonList: [],
reason: "",
refund_reason_wap_explain: "",
refund_reason_wap_img: []
};
},
mounted() {
this.id = this.$yroute.query.id || 0;
this.getOrderDetail();
this.getRefundReason();
},
methods: {
changeReason(e) {
this.reason = this.reasonList[e.mp.detail.value];
@ -143,11 +180,6 @@
});
});
}
},
mounted() {
this.id = this.$yroute.query.id || 0;
this.getOrderDetail();
this.getRefundReason();
}
};
</script>

39
pages/order/GoodsReturn/productlist.vue

@ -0,0 +1,39 @@
<template>
<view class="productList">
<view class="goodsStyle acea-row row-between"
v-for="cart in list"
:key="cart.id"
>
<view class="pictrue">
<image :src="cart.productInfo.image" class="image" />
</view>
<view class="text acea-row row-between">
<view class="name line2">{{ cart.productInfo.storeName }}</view>
<view class="money">
<view>
{{
cart.productInfo.attrInfo
? cart.productInfo.attrInfo.price
: cart.productInfo.price
}}
</view>
<view class="num">x{{ cart.cartNum }}</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
list: {
type: Array,
default: () => []
}
}
}
</script>
<style scoped lang="less">
</style>

27
pages/order/OrderDetails/index.vue

@ -239,12 +239,20 @@
<!-- -->
<template v-if="orderInfo.shippingType == 1 && status.type == 2">
<view class="bnt default"
@click="$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})">查看物流</view>
@click="$yrouter.push({
path: '/pages/order/Logistics/index',
query:{
id:orderInfo.orderId
}
})"
>查看物流</view>
<view class="bnt default" @click="goGoodsReturn(orderInfo)">申请退款</view>
<view class="bnt bg-color-red" @click="takeOrder">确认收货</view>
</template>
<template v-if="orderInfo.shippingType == 1 && status.type == 3 && orderInfo.deliveryType == 'express'">
<view class="bnt default"
@click="$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})">查看物流</view>
<view class="bnt default" @click="goGoodsReturn(orderInfo)">申请退款</view>
</template>
<template v-if="orderInfo.shippingType == 1 && status.type == 4">
<view class="bnt cancel" @click="delOrder">删除订单</view>
@ -256,10 +264,20 @@
<view class="bnt bg-color-red" @click="goGroupRule(orderInfo)">查看拼团</view>
</template>
</view>
<Payment v-model="pay" :types="payType" @checked="toPay" :balance="userInfo.nowMoney"></Payment>
<Payment
v-model="pay"
:types="payType"
@checked="toPay"
:balance="userInfo.nowMoney"
></Payment>
<view class="geoPage" v-if="mapShow">
<iframe width="100%" height="100%" frameborder="0" scrolling="no"
:src="'https://apis.map.qq.com/uri/v1/geocoder?coord=' + system_store.latitude + ',' +system_store.longitude +'&referer=' +mapKey"></iframe>
<iframe
width="100%"
height="100%"
frameborder="0"
scrolling="no"
:src="'https://apis.map.qq.com/uri/v1/geocoder?coord=' + system_store.latitude + ',' +system_store.longitude +'&referer=' +mapKey"
></iframe>
</view>
</view>
</template>
@ -329,6 +347,7 @@
},
methods: {
copyClipboard,
// 退
goGoodsReturn(orderInfo) {
this.$yrouter.push({
path: "/pages/order/GoodsReturn/index",

381
pages/user/Login/login.vue

@ -145,199 +145,196 @@
};
},
methods: {
async loginMobile() {
var that = this;
const {
account,
captcha
} = that;
try {
await that
.$validator({
account: [
required(required.message("手机号码")),
chs_phone(chs_phone.message())
],
captcha: [
required(required.message("验证码")),
alpha_num(alpha_num.message("验证码"))
]
})
.validate({
account,
captcha
});
} catch (e) {
return validatorDefaultCatch(e);
}
loginMobile({
phone: that.account,
captcha: that.captcha,
spread: cookie.get("spread")
})
.then(res => {
var data = res.data;
that.$store.commit("login", data.token, dayjs(data.expires_time));
handleGetUserInfo();
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
},
async register() {
var that = this;
const {
account,
captcha,
password
} = that;
try {
await that
.$validator({
account: [
required(required.message("手机号码")),
chs_phone(chs_phone.message())
],
captcha: [
required(required.message("验证码")),
alpha_num(alpha_num.message("验证码"))
],
password: [
required(required.message("密码")),
attrs.range([6, 16], attrs.range.message("密码")),
alpha_num(alpha_num.message("密码"))
]
})
.validate({
account,
captcha,
password
});
} catch (e) {
return validatorDefaultCatch(e);
}
register({
account: that.account,
captcha: that.captcha,
password: that.password,
inviteCode: that.inviteCode,
spread: cookie.get("spread")
})
.then(res => {
uni.showToast({
title: res.msg,
icon: "success",
duration: 2000
});
that.formItem = 1;
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
},
async code() {
var that = this;
const {
account
} = that;
try {
await that
.$validator({
account: [
required(required.message("手机号码")),
chs_phone(chs_phone.message())
]
})
.validate({
account
});
} catch (e) {
return validatorDefaultCatch(e);
}
if (that.formItem == 2) that.type = "register";
await registerVerify({
phone: that.account,
type: that.type
})
.then(res => {
uni.showToast({
title: res.msg,
icon: "success",
duration: 2000
});
that.sendCode();
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
},
navTap: function (index) {
this.current = index;
},
async submit() {
const {
account,
password
} = this;
try {
await this.$validator({
account: [
required(required.message("账号")),
attrs.range([5, 16], attrs.range.message("账号")),
alpha_num(alpha_num.message("账号"))
],
password: [
required(required.message("密码")),
attrs.range([6, 16], attrs.range.message("密码")),
alpha_num(alpha_num.message("密码"))
]
}).validate({
account,
password
});
} catch (e) {
return validatorDefaultCatch(e);
}
async loginMobile() {
var that = this;
const {
account,
captcha
} = that;
try {
await that
.$validator({
account: [
required(required.message("手机号码")),
chs_phone(chs_phone.message())
],
captcha: [
required(required.message("验证码")),
alpha_num(alpha_num.message("验证码"))
]
})
.validate({
account,
captcha
});
} catch (e) {
return validatorDefaultCatch(e);
}
loginMobile({
phone: that.account,
captcha: that.captcha,
spread: cookie.get("spread")
})
.then(res => {
var data = res.data;
that.$store.commit("login", data.token, dayjs(data.expires_time));
handleGetUserInfo();
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
},
async register() {
var that = this;
const {
account,
captcha,
password
} = that;
try {
await that
.$validator({
account: [
required(required.message("手机号码")),
chs_phone(chs_phone.message())
],
captcha: [
required(required.message("验证码")),
alpha_num(alpha_num.message("验证码"))
],
password: [
required(required.message("密码")),
attrs.range([6, 16], attrs.range.message("密码")),
alpha_num(alpha_num.message("密码"))
]
})
.validate({
account,
captcha,
password
});
} catch (e) {
return validatorDefaultCatch(e);
}
register({
account: that.account,
captcha: that.captcha,
password: that.password,
inviteCode: that.inviteCode,
spread: cookie.get("spread")
})
.then(res => {
uni.showToast({
title: res.msg,
icon: "success",
duration: 2000
});
that.formItem = 1;
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
},
async code() {
var that = this;
const {
account
} = that;
try {
await that
.$validator({
account: [
required(required.message("手机号码")),
chs_phone(chs_phone.message())
]
})
.validate({
account
});
} catch (e) {
return validatorDefaultCatch(e);
}
if (that.formItem == 2) that.type = "register";
await registerVerify({
phone: that.account,
type: that.type
})
.then(res => {
uni.showToast({
title: res.msg,
icon: "success",
duration: 2000
});
that.sendCode();
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
},
navTap: function (index) {
this.current = index;
},
async submit() {
const {
account,
password
} = this;
try {
await this.$validator({
account: [
required(required.message("账号")),
attrs.range([5, 16], attrs.range.message("账号")),
alpha_num(alpha_num.message("账号"))
],
password: [
required(required.message("密码")),
attrs.range([6, 16], attrs.range.message("密码")),
alpha_num(alpha_num.message("密码"))
]
}).validate({
account,
password
});
} catch (e) {
return validatorDefaultCatch(e);
}
login({
username: account,
password,
spread: cookie.get("spread")
})
.then(({ data }) => {
this.$store.commit("login", data.token, dayjs(data.expires_time));
handleGetUserInfo();
// let replace=this.$yroute.query.replace
// if(replace){
login({
username: account,
password,
spread: cookie.get("spread")
})
.then(({
data
}) => {
this.$store.commit("login", data.token, dayjs(data.expires_time));
handleGetUserInfo();
// let replace=this.$yroute.query.replace
// if(replace){
// }
// this.$yrouter.replace({
// path: this.$yroute.query.replace || '/pages/home/index'
// });
})
.catch(err => {
console.log(err);
uni.showToast({
title: err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
}
// }
// this.$yrouter.replace({
// path: this.$yroute.query.replace || '/pages/home/index'
// });
})
.catch(err => {
console.log(err);
uni.showToast({
title: err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
}
}
};
</script>

1
pages/user/User/index.vue

@ -314,7 +314,6 @@ export default {
iv: res.iv,
code: loginRes.code, // code
}).then(res => {
console.log(res === 200)
if (res.status === 200) {
this.userInfo.avatar = res.data.avatar
this.userInfo.nickname = res.data.nickname

2
utils/index.js

@ -524,7 +524,7 @@ export const handleLoginStatus = (location, complete, fail, success) => {
// 是否可以访问
let isAuth = false
console.log('即将跳转', location, parseUrl(location))
// console.log('即将跳转', location, parseUrl(location))
// 从 location 中获取当前url,location typeof string || object
let path = ''

4
utils/request.js

@ -22,12 +22,12 @@ fly.config.baseURL = VUE_APP_API_URL
// 小程序请求域名
// #ifdef MP-WEIXIN
fly.config.baseURL = 'http://itxzz.51vip.biz/api'
fly.config.baseURL = 'http://347i13244b.zicp.vip/api'
// #endif
// #ifdef APP-PLUS
// app端
fly.config.baseURL = 'http://itxzz.51vip.biz/api'
fly.config.baseURL = 'http://347i13244b.zicp.vip/api'
// #endif
fly.interceptors.response.use(

Loading…
Cancel
Save