合并冲突
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
{
|
||||
"launchtype" : "remote"
|
||||
},
|
||||
"h5" :
|
||||
"mp-weixin" :
|
||||
{
|
||||
"launchtype" : "remote"
|
||||
},
|
||||
|
64
api/aftersales.js
Normal file
64
api/aftersales.js
Normal file
@ -0,0 +1,64 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 提交售后
|
||||
/**
|
||||
*
|
||||
订单号 orderCode;
|
||||
服务类型 0仅退款1退货退款 serviceType;
|
||||
申请原因 reasonForApplication;
|
||||
申请说明 applicationInstructions;
|
||||
申请说明图片 applicationDescriptionPicture;
|
||||
商品数据 productParamList;
|
||||
*/
|
||||
export function submitAfterSealsOrder(data) {
|
||||
return request.post(`/applyForAfterSales`, data, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
// 售后订单列表
|
||||
export function getAfterSealsList (params) {
|
||||
return request.get('/storeAfterSales/list', params, {
|
||||
login: true,
|
||||
});
|
||||
}
|
||||
|
||||
// 售后详情
|
||||
export function getAfterSalesDeatail(key) {
|
||||
return request.get(`/applyForAfterSales/${key}`);
|
||||
}
|
||||
|
||||
// 查询订单
|
||||
export function getAfterSealsDetail (key, id) {
|
||||
return request.get(`/store/detail/${key}/${id}`)
|
||||
}
|
||||
|
||||
// 搜索
|
||||
export function searchAfterSealsDetail (key) {
|
||||
return request.get(`/store/detail/${key}`)
|
||||
}
|
||||
|
||||
// 撤销售后订单
|
||||
export function rebackAfterSeals (key, id) {
|
||||
return request.get(`/revoke/${key}/${id}`)
|
||||
}
|
||||
|
||||
// 获取物流信息
|
||||
export function getExpressData () {
|
||||
return request.get('/yxExpress')
|
||||
|
||||
}
|
||||
|
||||
// 添加快递单号
|
||||
export function addExpressData (params) {
|
||||
return request.post('/addLogisticsInformation?' + `code=${params.code}&name=${params.name}&postalCode=${params.postalCode}&orderCode=${params.orderCode}&`, '', {
|
||||
login: true
|
||||
})
|
||||
}
|
||||
|
||||
// 删除售后订单
|
||||
export function deleteAfterSeals (params) {
|
||||
return request.delete('/deleteAfterSalesOrder', params, {
|
||||
login: true
|
||||
})
|
||||
}
|
10
api/user.js
10
api/user.js
@ -63,7 +63,7 @@ export function register(data) {
|
||||
*/
|
||||
export function registerReset(data) {
|
||||
return request.post('/register/reset', data, {
|
||||
login: false,
|
||||
login: true,
|
||||
})
|
||||
}
|
||||
|
||||
@ -403,6 +403,14 @@ export function wxappBindingPhone(data) {
|
||||
return request.post('wxapp/binding', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序授权
|
||||
*/
|
||||
export function wxappGetUserInfo (data) {
|
||||
return request.post('/wxapp/loginAuth', data)
|
||||
//return request.get('/wechat/auth', data)
|
||||
}
|
||||
|
||||
/*
|
||||
* h5切换公众号登陆
|
||||
* */
|
||||
|
@ -42,8 +42,9 @@ export default {
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
data: function() {
|
||||
data() {
|
||||
return {
|
||||
timeInterval: null,
|
||||
time: this.datatime,
|
||||
day: '00',
|
||||
hour: '00',
|
||||
@ -51,7 +52,7 @@ export default {
|
||||
second: '00',
|
||||
}
|
||||
},
|
||||
created: function() {
|
||||
created() {
|
||||
this.show_time()
|
||||
},
|
||||
watch: {
|
||||
@ -61,10 +62,11 @@ export default {
|
||||
this.show_time()
|
||||
},
|
||||
},
|
||||
mounted: function() {},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
show_time: function() {
|
||||
let that = this
|
||||
show_time() {
|
||||
console.log(this.datatime)
|
||||
if (this.time.toString().length == 13) {
|
||||
// 毫秒级
|
||||
console.log('毫秒')
|
||||
@ -77,41 +79,43 @@ export default {
|
||||
console.log('时间')
|
||||
this.time = Date.parse(this.time) / 1000
|
||||
}
|
||||
|
||||
function runTime() {
|
||||
//时间函数
|
||||
let intDiff = that.time - Date.parse(new Date()) / 1000 //获取数据中的时间戳的时间差;
|
||||
let day = 0,
|
||||
hour = 0,
|
||||
minute = 0,
|
||||
second = 0
|
||||
if (intDiff > 0) {
|
||||
//转换时间
|
||||
if (that.isDay === true) {
|
||||
day = Math.floor(intDiff / (60 * 60 * 24))
|
||||
} else {
|
||||
day = 0
|
||||
}
|
||||
hour = Math.floor(intDiff / (60 * 60)) - day * 24
|
||||
minute = Math.floor(intDiff / 60) - day * 24 * 60 - hour * 60
|
||||
second = Math.floor(intDiff) - day * 24 * 60 * 60 - hour * 60 * 60 - minute * 60
|
||||
if (hour <= 9) hour = '0' + hour
|
||||
if (minute <= 9) minute = '0' + minute
|
||||
if (second <= 9) second = '0' + second
|
||||
that.day = day
|
||||
that.hour = hour
|
||||
that.minute = minute
|
||||
that.second = second
|
||||
} else {
|
||||
that.day = '00'
|
||||
that.hour = '00'
|
||||
that.minute = '00'
|
||||
that.second = '00'
|
||||
}
|
||||
}
|
||||
runTime()
|
||||
this.timeInterval = setInterval(runTime, 1000)
|
||||
this.runTime()
|
||||
this.timeInterval = setInterval(this.runTime, 1000)
|
||||
},
|
||||
runTime() {
|
||||
//时间函数
|
||||
let intDiff = this.time - Date.parse(new Date()) / 1000 //获取数据中的时间戳的时间差
|
||||
let day = 0,
|
||||
hour = 0,
|
||||
minute = 0,
|
||||
second = 0
|
||||
if (intDiff > 0) {
|
||||
//转换时间
|
||||
if (this.isDay === true) {
|
||||
day = Math.floor(intDiff / (60 * 60 * 24))
|
||||
} else {
|
||||
day = 0
|
||||
}
|
||||
hour = Math.floor(intDiff / (60 * 60)) - day * 24
|
||||
minute = Math.floor(intDiff / 60) - day * 24 * 60 - hour * 60
|
||||
second = Math.floor(intDiff) - day * 24 * 60 * 60 - hour * 60 * 60 - minute * 60
|
||||
if (hour <= 9) hour = '0' + hour
|
||||
if (minute <= 9) minute = '0' + minute
|
||||
if (second <= 9) second = '0' + second
|
||||
this.day = day
|
||||
this.hour = hour
|
||||
this.minute = minute
|
||||
this.second = second
|
||||
} else {
|
||||
this.day = '00'
|
||||
this.hour = '00'
|
||||
this.minute = '00'
|
||||
this.second = '00'
|
||||
}
|
||||
}
|
||||
},
|
||||
destroyed() {
|
||||
clearTimeout(this.timeInterval)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -83,6 +83,7 @@ export default {
|
||||
return {};
|
||||
},
|
||||
mounted: function () {
|
||||
console.log(this.attr)
|
||||
console.log(this);
|
||||
},
|
||||
watch: {
|
||||
|
@ -1,5 +1,6 @@
|
||||
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
|
||||
export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api'
|
||||
// export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api'
|
||||
export const VUE_APP_API_URL = '/h5api'
|
||||
// export const VUE_APP_API_URL = 'http://139.186.134.205:9006/api'
|
||||
// export const VUE_APP_API_URL = 'http://192.168.31.223:8008/api'
|
||||
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
|
||||
|
151
manifest.json
151
manifest.json
@ -69,11 +69,115 @@
|
||||
"UniversalLinks": "https://yixiang.co/app/"
|
||||
}
|
||||
},
|
||||
"share": {
|
||||
"weixin": {
|
||||
"appid": "wx7c84ede33062d1e4",
|
||||
"UniversalLinks": "https://yixiang.co/app/"
|
||||
}
|
||||
/* 应用发布信息 */
|
||||
"distribute" : {
|
||||
/* android打包配置 */
|
||||
"android" : {
|
||||
"permissions" : [
|
||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
|
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>"
|
||||
]
|
||||
},
|
||||
/* ios打包配置 */
|
||||
"ios" : {},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs" : {
|
||||
"oauth" : {
|
||||
"weixin" : {
|
||||
"appid" : "wx7c84ede33062d1e4",
|
||||
"appsecret" : "c47ef66d3311194da44e60387d5c1abd",
|
||||
"UniversalLinks" : "https://yixiang.co/app/"
|
||||
}
|
||||
},
|
||||
"payment" : {
|
||||
"weixin" : {
|
||||
"appid" : "wx7c84ede33062d1e4",
|
||||
"UniversalLinks" : "https://yixiang.co/app/"
|
||||
}
|
||||
},
|
||||
"share" : {
|
||||
"weixin" : {
|
||||
"appid" : "wx7c84ede33062d1e4",
|
||||
"UniversalLinks" : "https://yixiang.co/app/"
|
||||
}
|
||||
},
|
||||
"ad" : {},
|
||||
"geolocation" : {}
|
||||
},
|
||||
"splashscreen" : {
|
||||
"ios" : {
|
||||
"iphone" : {
|
||||
"portrait-896h@3x" : "splash/1242+2688.png",
|
||||
"portrait-896h@2x" : "splash/828+1792.png",
|
||||
"iphonex" : "splash/1125+2436.png",
|
||||
"retina55" : "splash/1142+2208.png",
|
||||
"retina47" : "splash/750+1334.png",
|
||||
"retina40" : "splash/640+1136.png",
|
||||
"retina35" : "splash/640+960.png"
|
||||
}
|
||||
},
|
||||
"android" : {
|
||||
"hdpi" : "splash/480+762.png",
|
||||
"xhdpi" : "splash/720+1242.png",
|
||||
"xxhdpi" : "splash/1080+1882.png"
|
||||
},
|
||||
"iosStyle" : "common"
|
||||
},
|
||||
"icons" : {
|
||||
"android" : {
|
||||
"hdpi" : "icons/72x72.png",
|
||||
"xhdpi" : "icons/96x96.png",
|
||||
"xxhdpi" : "icons/144x144.png",
|
||||
"xxxhdpi" : "icons/192x192.png"
|
||||
},
|
||||
"ios" : {
|
||||
"appstore" : "icons/1024x1024.png",
|
||||
"ipad" : {
|
||||
"app" : "icons/76x76.png",
|
||||
"app@2x" : "icons/152x152.png",
|
||||
"notification" : "icons/20x20.png",
|
||||
"notification@2x" : "icons/40x40.png",
|
||||
"proapp@2x" : "icons/167x167.png",
|
||||
"settings" : "icons/29x29.png",
|
||||
"settings@2x" : "icons/58x58.png",
|
||||
"spotlight" : "icons/40x40.png",
|
||||
"spotlight@2x" : "icons/80x80.png"
|
||||
},
|
||||
"iphone" : {
|
||||
"app@2x" : "icons/120x120.png",
|
||||
"app@3x" : "icons/180x180.png",
|
||||
"notification@2x" : "icons/40x40.png",
|
||||
"notification@3x" : "icons/60x60.png",
|
||||
"settings@2x" : "icons/58x58.png",
|
||||
"settings@3x" : "icons/87x87.png",
|
||||
"spotlight@2x" : "icons/80x80.png",
|
||||
"spotlight@3x" : "icons/120x120.png"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"quickapp" : {},
|
||||
"mp-weixin" : {
|
||||
"appid" : "wx604d2ea4702620d2",
|
||||
"setting" : {
|
||||
"urlCheck" : true,
|
||||
"postcss" : true,
|
||||
"minified" : true
|
||||
},
|
||||
"ad": {},
|
||||
"geolocation": {}
|
||||
@ -179,13 +283,32 @@
|
||||
"router": {
|
||||
"mode": "history"
|
||||
},
|
||||
"sdkConfigs": {
|
||||
"maps": {
|
||||
"qqmap": {
|
||||
"key": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"domain": "h5.yixiang.co"
|
||||
}
|
||||
"h5" : {
|
||||
"title" : "yshop",
|
||||
"devServer" : {
|
||||
"disableHostCheck" : true,
|
||||
"proxy" : {
|
||||
"/h5api" : {
|
||||
// 需要被代理的后台地址
|
||||
"target" : "http://itxzz.51vip.biz/",
|
||||
"changeOrigin" : true,
|
||||
"secure" : false,
|
||||
"pathRewrite" : {
|
||||
"^/h5api" : "/api"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"router" : {
|
||||
"mode" : "history"
|
||||
},
|
||||
"sdkConfigs" : {
|
||||
"maps" : {
|
||||
"qqmap" : {
|
||||
"key" : ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"domain" : "h5.yixiang.co"
|
||||
}
|
||||
}
|
||||
|
19
pages.json
19
pages.json
@ -25,7 +25,8 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/user/RetrievePassword/index",
|
||||
// "path": "pages/user/RetrievePassword/index",
|
||||
"path": "pages/user/ChangePassword/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "重置密码"
|
||||
}
|
||||
@ -296,6 +297,12 @@
|
||||
"navigationBarTitleText": "订单详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/order/OrderReturnDetail/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "售后详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/order/OrderSubmission/index",
|
||||
"style": {
|
||||
@ -317,9 +324,15 @@
|
||||
{
|
||||
"path": "pages/order/ReturnList/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "退货列表"
|
||||
"navigationBarTitleText": "我的售后"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/order/submitExpress/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "售后物流填写"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/orderAdmin/OrderIndex/index",
|
||||
"style": {
|
||||
@ -422,7 +435,7 @@
|
||||
"navigationBarTitleText": "直播列表"
|
||||
}
|
||||
}
|
||||
],
|
||||
],
|
||||
"easycom": {
|
||||
"autoscan": true,
|
||||
"custom": {
|
||||
|
@ -38,8 +38,8 @@
|
||||
<text class="num" v-text="bargainHelpCount.remainingPrice"></text>
|
||||
</view>
|
||||
<view class="acea-row row-middle">
|
||||
<view class="successNum" v-text="'原价' + goodsDetail.price"></view>
|
||||
<view class="successNum" v-text="'已有' + bargainSumCount + '人砍价成功'"></view>
|
||||
<view class="successNum" v-text="`原价:${goodsDetail.price || 0}`"></view>
|
||||
<view class="successNum" v-text="`已有${bargainSumCount || 0}人砍价成功`"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -51,9 +51,9 @@
|
||||
|
||||
<!-- 砍价进度条下的金额 -->
|
||||
<view class="balance acea-row row-between-wrapper">
|
||||
<view v-text="'已砍' + bargainHelpCount.alreadyPrice + '元'"></view>
|
||||
<view v-text="`已砍${bargainHelpCount.alreadyPrice || 0}元`"></view>
|
||||
<view v-if="bargainHelpCount.price === 0">砍价成功</view>
|
||||
<view v-else v-text="'还剩' + bargainHelpCount.price + '元'"></view>
|
||||
<view v-else v-text="`还剩${bargainHelpCount.price || 0}元`"></view>
|
||||
</view>
|
||||
|
||||
<!-- 砍价成功:-->
|
||||
|
@ -9,7 +9,8 @@
|
||||
</view>
|
||||
<view class="group-box">
|
||||
<view class="goods-item" v-for="(groupon, index) in grouponList" :key="groupon.id">
|
||||
<activity-card :cid="groupon.id" :title="groupon.title" :info="groupon.info" :img="groupon.image" :price="groupon.price" :productPrice="groupon.productPrice">
|
||||
<activity-card
|
||||
:cid="groupon.id" :title="groupon.title" :info="groupon.info" :img="groupon.image" :price="groupon.price" :productPrice="groupon.productPrice">
|
||||
<block slot="tag">
|
||||
<view class="tag" v-if="index < 3">TOP{{ index + 1 }}</view>
|
||||
</block>
|
||||
@ -22,7 +23,9 @@
|
||||
<text class="group-num">{{ groupon.people || 0 }}人团</text>
|
||||
</view>
|
||||
</block>
|
||||
<block slot="btn"><button class="cu-btn buy-btn" @tap.stop="jump('/pages/activity/GroupDetails/index', { id: groupon.id })">马上拼</button></block>
|
||||
<block slot="btn">
|
||||
<button class="cu-btn buy-btn"
|
||||
@tap.stop="jump('/pages/activity/GroupDetails/index', { id: groupon.id })">马上拼</button></block>
|
||||
</activity-card>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -3,6 +3,7 @@
|
||||
<view class="tui-bg__box">
|
||||
<image :src="`${$VUE_APP_RESOURCES_URL}/images/bg_seckill.png`" class="tui-bg__img" mode="widthFix" :style="{ opacity: opacity }"></image>
|
||||
</view>
|
||||
|
||||
<view class="tui-header__bg">
|
||||
<image :src="`${$VUE_APP_RESOURCES_URL}/images/bg_seckill.png`" class="tui-bg__img" mode="widthFix"></image>
|
||||
<scroll-view class="tui-time-slot" scroll-x>
|
||||
@ -37,7 +38,7 @@
|
||||
</view>
|
||||
<view class="tui-countdown__box" v-if="item.status == 1 || item.status == 2">
|
||||
<text>距离{{ item.status == 1 ? '结束还剩' : '开始还有' }}</text>
|
||||
<count-down :isDay="true" :tipText="'倒计时 '" :dayText="' 天 '" :hourText="' 时 '" :minuteText="' 分 '" :secondText="' 秒'" :datatime="item.stop"></count-down>
|
||||
<CountDown :isDay="true" :tipText="'倒计时 '" :dayText="' 天 '" :hourText="' 时 '" :minuteText="' 分 '" :secondText="' 秒'" :datatime="item.stop"></CountDown>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
@ -163,6 +164,7 @@ export default {
|
||||
that.status = false
|
||||
that.active = index
|
||||
that.datatime = that.timeList[that.active].stop
|
||||
console.log(new Date(that.datatime))
|
||||
this.seckillList = []
|
||||
that.getSeckillList()
|
||||
},
|
||||
@ -212,6 +214,9 @@ export default {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
/* #ifdef H5 */
|
||||
top: 80rpx;
|
||||
/* #endif */
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
@ -221,6 +226,9 @@ export default {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
/* #ifdef H5 */
|
||||
top: 80rpx;
|
||||
/* #endif */
|
||||
z-index: 3;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
@ -260,7 +260,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
formatPrice(price, index) {
|
||||
console.log(price)
|
||||
// console.log(price)
|
||||
if (price) {
|
||||
return price.split('.')[index]
|
||||
}
|
||||
@ -284,15 +284,6 @@ export default {
|
||||
},
|
||||
}
|
||||
},
|
||||
openAlone: function() {
|
||||
this.$yrouter.push({
|
||||
path: '/pages/shop/GoodsCon/index',
|
||||
query: {
|
||||
id: this.storeInfo.productId,
|
||||
},
|
||||
})
|
||||
// this.$yrouter.replace({ path: "/detail/" + this.storeInfo.productId });
|
||||
},
|
||||
//收藏商品
|
||||
setCollect: function() {
|
||||
let that = this,
|
||||
@ -452,24 +443,41 @@ export default {
|
||||
this.$set(this, 'attrTxt', '请选择')
|
||||
}
|
||||
},
|
||||
|
||||
// 单独购买
|
||||
openAlone: function() {
|
||||
this.$yrouter.push({
|
||||
path: '/pages/shop/GoodsCon/index',
|
||||
query: {
|
||||
id: this.storeInfo.productId,
|
||||
},
|
||||
})
|
||||
// this.$yrouter.replace({ path: "/detail/" + this.storeInfo.productId });
|
||||
},
|
||||
// 发起拼团
|
||||
openTeam: function() {
|
||||
var that = this
|
||||
if (that.attr.cartAttr == false) {
|
||||
console.log(this.attr)
|
||||
if (that.attr.cartAttr == false) { // 展示弹框
|
||||
console.log(this.attr.cartAttr)
|
||||
that.attr.cartAttr = !this.attr.cartAttr
|
||||
} else {
|
||||
// 设置拼团价格
|
||||
that.attr.productSelect.price = this.storeInfo.price
|
||||
} else { // 已有弹框——初始化商品信息,下单请求
|
||||
var data = {}
|
||||
data.productId = that.storeInfo.productId
|
||||
data.price = that.storeInfo.price
|
||||
data.cartNum = that.attr.productSelect.cart_num
|
||||
data.uniqueId = that.attr.productSelect.unique
|
||||
data.combinationId = that.storeInfo.id
|
||||
data.new = 1
|
||||
console.log(data)
|
||||
postCartAdd(data)
|
||||
.then(res => {
|
||||
that.$yrouter.push({
|
||||
path: '/pages/order/OrderSubmission/index',
|
||||
query: {
|
||||
id: res.data.cartId,
|
||||
// id: res.data.cartId,
|
||||
pinkId: res.data.cartId,
|
||||
},
|
||||
})
|
||||
})
|
||||
|
@ -7,11 +7,11 @@
|
||||
<view class="tui-price__box">
|
||||
<view class="tui-goods-price">
|
||||
<view class="tui-size-24">¥</view>
|
||||
<view class="tui-price-large">{{ storeCombination.price.split('.')[0] }}</view>
|
||||
<view class="tui-size-24">.{{ storeCombination.price.split('.')[1] }}</view>
|
||||
<view class="tui-price-large">{{ storeCombination.price.split('.')[0] || 0 }}</view>
|
||||
<view class="tui-size-24">.{{ storeCombination.price.split('.')[1] || 0 }}</view>
|
||||
<!-- <text>已拼2020件</text> -->
|
||||
</view>
|
||||
<view class="tui-price-tag">{{ storeCombination.people }}人团</view>
|
||||
<view class="tui-price-tag">{{ storeCombination.people || 0 }}人团</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -96,15 +96,14 @@ export default {
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted: function() {
|
||||
var that = this
|
||||
mounted() {
|
||||
let url = handleQrCode()
|
||||
if (url) {
|
||||
that.pinkId = url.pinkId
|
||||
this.pinkId = url.pinkId
|
||||
} else {
|
||||
that.pinkId = that.$yroute.query.id
|
||||
this.pinkId = this.$yroute.query.id
|
||||
}
|
||||
that.getCombinationPink()
|
||||
this.getCombinationPink()
|
||||
},
|
||||
methods: {
|
||||
pay: function() {
|
||||
|
@ -1,10 +1,17 @@
|
||||
<template>
|
||||
<view class="poster-poster" v-if="status === false">
|
||||
<view class="tip">
|
||||
<text class="iconfont icon-shuoming"></text>提示:长按图片保存至手机相册
|
||||
<!-- #ifndef H5 -->
|
||||
<text class="iconfont icon-shuoming"></text>提示:长按图片保存至手机相册
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<view class="poster">
|
||||
<image :src="image" mode="widthFix" show-menu-by-longpress />
|
||||
<!-- #ifndef APP-PLUS -->
|
||||
<image :src="image" mode="widthFix" show-menu-by-longpress />
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<image :src="image" mode="widthFix" @longtap="longtap"/>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -18,73 +25,95 @@
|
||||
name: "Poster",
|
||||
components: {},
|
||||
props: {},
|
||||
data: function () {
|
||||
data () {
|
||||
return {
|
||||
status: true,
|
||||
id: 0,
|
||||
image: ""
|
||||
};
|
||||
},
|
||||
mounted: function () {
|
||||
var that = this;
|
||||
var id = that.$yroute.query.id;
|
||||
var type = that.$yroute.query.type;
|
||||
that.id = id;
|
||||
mounted () {
|
||||
var id = this.$yroute.query.id;
|
||||
var type = this.$yroute.query.type;
|
||||
this.id = id;
|
||||
if (type == 2) {
|
||||
that.getBargainPoster();
|
||||
this.getBargainPoster();
|
||||
} else {
|
||||
that.getCombinationPoster();
|
||||
this.getCombinationPoster();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 砍价海报
|
||||
getBargainPoster: function () {
|
||||
var that = this;
|
||||
let from = this.$deviceType
|
||||
if (from == 'weixin' || this.$deviceType == 'weixinh5') {
|
||||
from = 'uniappH5'
|
||||
}
|
||||
getBargainPoster({
|
||||
bargainId: that.id,
|
||||
from
|
||||
})
|
||||
.then(res => {
|
||||
that.image = res.data.url;
|
||||
that.status = false;
|
||||
})
|
||||
.catch(res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
// 拼团海报
|
||||
getCombinationPoster: function () {
|
||||
var that = this;
|
||||
console.log(this.$deviceType)
|
||||
let from = this.$deviceType
|
||||
if (from == 'weixin' || this.$deviceType == 'weixinh5') {
|
||||
from = 'uniappH5'
|
||||
}
|
||||
console.log(from)
|
||||
getCombinationPoster({
|
||||
id: that.id,
|
||||
from
|
||||
})
|
||||
.then(res => {
|
||||
that.image = res.data.url;
|
||||
that.status = false;
|
||||
})
|
||||
.catch(res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
}
|
||||
// 砍价海报
|
||||
getBargainPoster: function () {
|
||||
var that = this;
|
||||
let from = this.$deviceType
|
||||
if (from == 'weixin' || this.$deviceType == 'weixinh5') {
|
||||
from = 'uniappH5'
|
||||
}
|
||||
getBargainPoster({
|
||||
bargainId: that.id,
|
||||
from
|
||||
})
|
||||
.then(res => {
|
||||
that.image = res.data.url;
|
||||
that.status = false;
|
||||
})
|
||||
.catch(res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
// 拼团海报
|
||||
getCombinationPoster: function () {
|
||||
var that = this;
|
||||
console.log(this.$deviceType)
|
||||
let from = this.$deviceType
|
||||
if (from == 'weixin' || this.$deviceType == 'weixinh5') {
|
||||
from = 'uniappH5'
|
||||
}
|
||||
console.log(from)
|
||||
getCombinationPoster({
|
||||
id: that.id,
|
||||
from
|
||||
})
|
||||
.then(res => {
|
||||
that.image = res.data.url;
|
||||
that.status = false;
|
||||
})
|
||||
.catch(res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
// app端长按保存
|
||||
longtap () {
|
||||
// 先下载图片
|
||||
uni.downloadFile({
|
||||
url: this.img,
|
||||
success: (res) => {
|
||||
// 获取到图片本地地址后再保存图片到相册(因为此方法不支持远程地址)
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: res.tempFilePath,
|
||||
success: () => {
|
||||
uni.showToast({
|
||||
title: "保存成功!",
|
||||
});
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({
|
||||
title: "保存失败",
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -6,10 +6,14 @@
|
||||
<view class="force-login__content y-f">
|
||||
<open-data class="user-avatar" type="userAvatarUrl"></open-data>
|
||||
<open-data class="user-name" type="userNickName"></open-data>
|
||||
<view class="login-notice">为了提供更优质的服务,需要获取您的头像昵称</view>
|
||||
<button class="cu-btn author-btn" v-if="canIUseGetUserProfile" @tap="getUserInfoProfile">授权并查看</button>
|
||||
<button class="cu-btn author-btn" v-else @getuserinfo="getUserInfo" open-type="getUserInfo">授权并查看</button>
|
||||
<button class="cu-btn close-btn" @tap="back">暂不授权</button>
|
||||
<view class="login-notice">为了提供更优质的服务,请先登录</view>
|
||||
<button
|
||||
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>
|
||||
<!-- #endif -->
|
||||
@ -27,27 +31,28 @@
|
||||
|
||||
<script>
|
||||
import { mapState, mapMutations, mapActions } from 'vuex'
|
||||
import { wxappAuth, getUser } from '@/api/user'
|
||||
import { wxappAuth, getUser, getUserInfo } from '@/api/user'
|
||||
import { login, authorize, getProvider } from '@/utils'
|
||||
import dayjs from 'dayjs'
|
||||
import cookie from '@/utils/store/cookie'
|
||||
import { login, authorize } from '@/utils'
|
||||
import store from '@/store'
|
||||
|
||||
// 公众号登录
|
||||
import { auth } from '@/libs/wechat.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
authorize: false,
|
||||
canIUseGetUserProfile: false,
|
||||
canIUseGetUserProfile: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['isAuthorization', '$deviceType', 'token']),
|
||||
},
|
||||
onLoad() {
|
||||
console.log(wx.getUserProfile)
|
||||
if (wx.getUserProfile) {
|
||||
console.log(this)
|
||||
this.canIUseGetUserProfile = true
|
||||
console.log(this.canIUseGetUserProfile)
|
||||
}
|
||||
// // 先校验用户是否授权,如果没有授权,显示授权按钮
|
||||
},
|
||||
@ -74,9 +79,9 @@ export default {
|
||||
query: {},
|
||||
})
|
||||
},
|
||||
getUserInfo(data) {
|
||||
getUserInfoBtn(data) {
|
||||
console.log(data)
|
||||
console.log('getUserInfo')
|
||||
console.log('getUserInfoBtn')
|
||||
if (data.detail.errMsg == 'getUserInfo:fail auth deny') {
|
||||
uni.showToast({
|
||||
title: '取消授权',
|
||||
@ -106,13 +111,14 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
// 申请获取用户信息
|
||||
getUserInfoProfile(data) {
|
||||
console.log('getUserInfoProfile')
|
||||
wx.getUserProfile({
|
||||
lang: 'zh_CN',
|
||||
desc: '需要获取您的信息用来展示',
|
||||
success: res => {
|
||||
console.log(res)
|
||||
console.log('用户信息',res)
|
||||
uni.showLoading({
|
||||
title: '登录中',
|
||||
})
|
||||
@ -134,10 +140,67 @@ export default {
|
||||
},
|
||||
})
|
||||
},
|
||||
// 微信用户手机号登录
|
||||
phoneLogin(e) {
|
||||
console.log('用户微信手机号登录')
|
||||
if (e.mp.detail.errMsg == 'getPhoneNumber:ok') {
|
||||
console.log(e.mp.detail)
|
||||
getProvider()
|
||||
.then(provider => {
|
||||
console.log('当前的环境商',provider)
|
||||
if (!provider) {
|
||||
reject()
|
||||
}
|
||||
// uni登录
|
||||
uni.login({
|
||||
provider: provider,
|
||||
success: async loginRes => {
|
||||
console.log(loginRes)
|
||||
let code = loginRes.code // 获取开发code
|
||||
cookie.set('wxLoginCode', loginRes.code)
|
||||
wxappAuth({
|
||||
encryptedData: e.mp.detail.encryptedData,
|
||||
iv: e.mp.detail.iv,
|
||||
code: code,
|
||||
spread: cookie.get('spread'),
|
||||
})
|
||||
.then( res => {
|
||||
console.log('登录成功,开始处理登录信息保存,并获取用户详情')
|
||||
uni.hideLoading()
|
||||
store.commit('login', res.data.token, dayjs(res.data.expires_time))
|
||||
store.dispatch('userInfo', true)
|
||||
getUserInfo()
|
||||
.then(user => {
|
||||
console.log('获取用户信息成功')
|
||||
uni.setStorageSync('uid', user.data.uid)
|
||||
store.dispatch('setUserInfo', user.data)
|
||||
this.$yrouter.reLaunch({
|
||||
path: cookie.get('redirect').replace(/\ /g, ''),
|
||||
})
|
||||
})
|
||||
.catch(error => {
|
||||
console.log('获取用户信息失败')
|
||||
})
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error)
|
||||
console.log('登录接口调用失败')
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(err => {})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '已拒绝授权',
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
if (wx.getUserProfile) {
|
||||
console.log(this)
|
||||
this.canIUseGetUserProfile = true
|
||||
console.log(this.canIUseGetUserProfile)
|
||||
}
|
||||
|
@ -19,33 +19,53 @@
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<Banner v-if="item.type == 'banner'" :detail="item.componentContent.bannerData" @getbgcolor="getbgcolor"></Banner>
|
||||
<uni-notice-bar v-if="item.type == 'noticeBar'" scrollable="true" @click="goRoll(item.componentContent.roll[0])" single="true" :speed="10" showIcon="true" :text="item.componentContent.roll[0].info"></uni-notice-bar>
|
||||
<view class="content_box home_content_box" v-if="item.type == 'menu' && item.componentContent.menus">
|
||||
<Banner v-if="item.type == 'banner'"
|
||||
:detail="item.componentContent.bannerData"
|
||||
@getbgcolor="getbgcolor"></Banner>
|
||||
<uni-notice-bar
|
||||
v-if="item.type == 'noticeBar'"
|
||||
scrollable="true"
|
||||
@click="goRoll(item.componentContent.roll[0])"
|
||||
single="true" :speed="10"
|
||||
showIcon="true"
|
||||
:text="item.componentContent.roll[0].info"></uni-notice-bar>
|
||||
<view class="content_box home_content_box"
|
||||
v-if="item.type == 'menu' && item.componentContent.menus">
|
||||
<!-- 菜单 -->
|
||||
<Menu :list="item.componentContent.menus"></Menu>
|
||||
</view>
|
||||
<!-- 滚动新闻 -->
|
||||
<!-- 广告 -->
|
||||
<Adv v-if="item.type == 'adv' && item.componentContent.detail" :detail="item.componentContent.detail" />
|
||||
<Adv v-if="item.type == 'adv' && item.componentContent.detail"
|
||||
:detail="item.componentContent.detail" />
|
||||
<!-- 热门榜单 -->
|
||||
<HotCommodity v-if="item.type == 'hotCommodity'" :detail="likeInfo"></HotCommodity>
|
||||
<HotCommodity v-if="item.type == 'hotCommodity'"
|
||||
:detail="likeInfo" />
|
||||
<!-- 超值拼团 -->
|
||||
<Groupon v-if="item.type == 'groupon'" :detail="combinationList" />
|
||||
<!-- 首发新品->秒杀 -->
|
||||
<FirstNewProduct v-if="item.type == 'firstNewProduct'" :detail="firstList"></FirstNewProduct>
|
||||
<FirstNewProduct v-if="item.type == 'firstNewProduct'"
|
||||
:detail="firstList" />
|
||||
<!-- 精品推荐 -->
|
||||
<ProductsRecommended v-if="item.type == 'productsRecommended'" :detail="bastList"></ProductsRecommended>
|
||||
<ProductsRecommended v-if="item.type == 'productsRecommended'"
|
||||
:detail="bastList" />
|
||||
<!-- 促销单品 -->
|
||||
<PromoteProduct v-if="item.type == 'promoteProduct'" :detail="benefit"></PromoteProduct>
|
||||
<PromoteProduct v-if="item.type == 'promoteProduct'"
|
||||
:detail="benefit" />
|
||||
<!-- 直播 -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<Live v-if="item.type == 'live'" :detail="live"></Live>
|
||||
<Live v-if="item.type == 'live'" :detail="live" />
|
||||
<!-- #endif -->
|
||||
<!-- 为您推荐 -->
|
||||
<PromotionGood v-if="item.type == 'promotionGood'" :benefit="benefit"></PromotionGood>
|
||||
<Coupon-window :coupon-list="couponList" v-if="showCoupon" @checked="couponClose" @close="couponClose"> </Coupon-window>
|
||||
<PromotionGood v-if="item.type == 'promotionGood'" :benefit="benefit" />
|
||||
<Coupon-window
|
||||
:coupon-list="couponList"
|
||||
v-if="showCoupon"
|
||||
@checked="couponClose" @close="couponClose" />
|
||||
</view>
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="bottomSpace" style='line-height:100rpx'>正在使用H5方式浏览</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
@ -178,6 +198,7 @@ export default {
|
||||
observeParents: true,
|
||||
},
|
||||
bgImage: '',
|
||||
// indexTitle: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -194,34 +215,40 @@ export default {
|
||||
return style
|
||||
},
|
||||
},
|
||||
onLoad: function() {
|
||||
onLoad() {
|
||||
this.getLocation()
|
||||
let that = this
|
||||
// uni.showLoading({
|
||||
// title: "加载中",
|
||||
// });
|
||||
getCanvas()
|
||||
.then(res => {})
|
||||
.then(res => {
|
||||
console.log('223',res)
|
||||
})
|
||||
.catch(error => {
|
||||
if (!error) {
|
||||
return
|
||||
}
|
||||
this.homeData = JSON.parse(error.data.json)
|
||||
console.log(this.homeData)
|
||||
console.log(222)
|
||||
console.log('225',this.homeData)
|
||||
})
|
||||
getHomeData().then(res => {
|
||||
that.logoUrl = res.data.logoUrl
|
||||
res.data.banner.map(item => (item.bgcolor = item.color || ''))
|
||||
that.$set(that, 'info', res.data.info)
|
||||
that.$set(that, 'firstList', res.data.firstList)
|
||||
that.$set(that, 'bastList', res.data.bastList)
|
||||
that.$set(that, 'likeInfo', res.data.likeInfo)
|
||||
that.$set(that, 'live', res.data.liveList)
|
||||
that.$set(that, 'lovely', res.data.lovely)
|
||||
that.$set(that, 'benefit', res.data.benefit)
|
||||
that.$set(that, 'couponList', res.data.couponList)
|
||||
that.$set(that, 'combinationList', res.data.combinationList)
|
||||
this.logoUrl = res.data.logoUrl
|
||||
res.data.banner.forEach(item => (item.bgcolor = item.color || ''))
|
||||
this.info = res.data.info
|
||||
console.log('239', res.data.info)
|
||||
console.log('239',this.info)
|
||||
this.$set(this, 'info', res.data.info)
|
||||
this.$set(this, 'firstList', res.data.firstList)
|
||||
this.$set(this, 'bastList', res.data.bastList)
|
||||
this.$set(this, 'likeInfo', res.data.likeInfo)
|
||||
this.$set(this, 'live', res.data.liveList)
|
||||
this.$set(this, 'lovely', res.data.lovely)
|
||||
this.$set(this, 'benefit', res.data.benefit)
|
||||
this.$set(this, 'couponList', res.data.couponList)
|
||||
this.$set(this, 'combinationList', res.data.combinationList)
|
||||
uni.hideLoading()
|
||||
that.setOpenShare()
|
||||
// that.doColorThief()
|
||||
this.setOpenShare()
|
||||
// this.doColorThief()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
@ -288,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
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
|
@ -1,153 +1,394 @@
|
||||
<!-- 售后提交 -->
|
||||
<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>
|
||||
<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="container" v-if="selected">
|
||||
<view class="goodsStyle acea-row row-between"
|
||||
v-for="cart in selectProduct"
|
||||
: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 class="num">x{{ cart.cartNum }}</view>
|
||||
</view>
|
||||
</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="list">
|
||||
<view v-if="serviceType === 1" class="item acea-row row-between-wrapper">
|
||||
<view>退货件数</view>
|
||||
<view class="num">{{ totalNum || 0 }}</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view>退款原因</view>
|
||||
<view class="num">{{reason}}</view>
|
||||
<text class="iconfont icon-jiantou"></text>
|
||||
<view>退款金额</view>
|
||||
<view class="num">¥{{ totalMoney || 0 }}</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>
|
||||
</picker>
|
||||
<view class="item textarea acea-row row-between">
|
||||
<view>备注说明</view>
|
||||
<textarea class="num"
|
||||
placeholder="填写备注信息,100字以内"
|
||||
v-model="refund_reason_wap_explain"
|
||||
></textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="serviceType === 0"
|
||||
class="returnBnt bg-color-red"
|
||||
@click="submit"
|
||||
>申请退款</view>
|
||||
<view v-if="serviceType === 1"
|
||||
class="returnBnt bg-color-red"
|
||||
@click="submit"
|
||||
>申请退货</view>
|
||||
</view>
|
||||
<!-- 选择商品 -->
|
||||
<view class="selectProduct" v-else>
|
||||
<view class="selectContainer"
|
||||
v-for="(cart, index) in selectProduct"
|
||||
:key="cart.id"
|
||||
>
|
||||
<view class="checkbox-wrapper">
|
||||
<checkbox-group @change="switchSelect(index)">
|
||||
<label class="well-check">
|
||||
<checkbox color="#eb3729" value :checked="cart.checked"></checkbox>
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
<view class="pictrue">
|
||||
<image :src="cart.productInfo.image" class="image" />
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="title">{{ cart.productInfo.storeName || '' }}</view>
|
||||
<view class="skus">
|
||||
<view class="sku">
|
||||
{{ cart.productInfo.attrInfo.sku || '' }}
|
||||
</view>
|
||||
<view class="num">x{{ cart.cartNum || 0 }}</view>
|
||||
</view>
|
||||
<view class="money">
|
||||
¥<view>
|
||||
{{
|
||||
cart.productInfo.attrInfo
|
||||
? cart.productInfo.attrInfo.price
|
||||
: cart.productInfo.price
|
||||
}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="choose">
|
||||
<view class="checkTotal">
|
||||
<checkbox-group @change="allChecked">
|
||||
<label class="well-check">
|
||||
<checkbox
|
||||
color="#eb3729"
|
||||
value="allSelect"
|
||||
:checked="isAllSelect"
|
||||
></checkbox>
|
||||
<text class="checkAll">全选 ({{ cartCount || 0 }})</text>
|
||||
</label>
|
||||
</checkbox-group>
|
||||
<view class="total">
|
||||
<view class="proTotal">
|
||||
{{ orderInfo.totalNum || 0 }}件商品
|
||||
</view>
|
||||
<view class="moneyTotal">
|
||||
合计 ¥ {{ orderInfo.totalPrice || 0 }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="typeBtn">
|
||||
<view class="button def" @click="chooseType(0)">仅退款</view>
|
||||
<view class="button redBtn" @click="chooseType(1)">退货退款</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>
|
||||
|
||||
<script>
|
||||
import {
|
||||
orderDetail,
|
||||
getRefundReason,
|
||||
postOrderRefund
|
||||
} from "@/api/order";
|
||||
import {
|
||||
trim
|
||||
} from "@/utils";
|
||||
import {
|
||||
VUE_APP_API_URL
|
||||
} from "@/config";
|
||||
import {
|
||||
orderDetail,
|
||||
getRefundReason,
|
||||
postOrderRefund
|
||||
} from "@/api/order";
|
||||
import {
|
||||
submitAfterSealsOrder
|
||||
} from '@/api/aftersales.js';
|
||||
import {
|
||||
trim
|
||||
} from "@/utils";
|
||||
import {
|
||||
VUE_APP_API_URL
|
||||
} from "@/config";
|
||||
|
||||
export default {
|
||||
name: "goodsReturn",
|
||||
components: {
|
||||
// VueCoreImageUpload
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
url: `${VUE_APP_API_URL}/upload/image`,
|
||||
headers: {
|
||||
Authorization: "Bearer " + this.$store.state.token
|
||||
},
|
||||
id: 0,
|
||||
orderInfo: {},
|
||||
reasonList: [],
|
||||
reason: "",
|
||||
refund_reason_wap_explain: "",
|
||||
refund_reason_wap_img: []
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
changeReason(e) {
|
||||
this.reason = this.reasonList[e.mp.detail.value];
|
||||
export default {
|
||||
name: "goodsReturn",
|
||||
components: {
|
||||
// VueCoreImageUpload
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
url: `${VUE_APP_API_URL}/upload/image`,
|
||||
headers: {
|
||||
Authorization: "Bearer " + this.$store.state.token
|
||||
},
|
||||
imageuploaded(res) {
|
||||
if (res.status !== 200) {
|
||||
id: 0,
|
||||
selected: false,
|
||||
orderInfo: {},
|
||||
rebackList: [],
|
||||
reasonList: [],
|
||||
reason: "",
|
||||
refund_reason_wap_explain: '',
|
||||
refund_reason_wap_img: [],
|
||||
serviceType: null,
|
||||
// 选中售后商品
|
||||
selectProduct: [],
|
||||
productParamList: [],
|
||||
totalNum: 0,
|
||||
totalMoney: 0,
|
||||
isAllSelect: false
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.id = this.$yroute.query.id || 0;
|
||||
this.getOrderDetail();
|
||||
this.getRefundReason();
|
||||
},
|
||||
methods: {
|
||||
changeReason(e) {
|
||||
this.reason = this.reasonList[e.mp.detail.value];
|
||||
},
|
||||
imageuploaded(res) {
|
||||
if (res.status !== 200) {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return
|
||||
}
|
||||
this.refund_reason_wap_img.push(res.data.url);
|
||||
},
|
||||
getOrderDetail() {
|
||||
uni.showLoading({
|
||||
title: '正在查询商品',
|
||||
duration: 2000,
|
||||
})
|
||||
orderDetail(this.id)
|
||||
.then(res => {
|
||||
this.orderInfo = res.data;
|
||||
this.selectProduct = res.data.cartInfo.map(item => {
|
||||
item.checked = false
|
||||
return item
|
||||
})
|
||||
if (res.data.cartInfo.length === 0) {
|
||||
uni.showToast({
|
||||
title: "订单无可售后商品",
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return
|
||||
}
|
||||
uni.hideLoading()
|
||||
})
|
||||
.catch(err => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return
|
||||
}
|
||||
this.refund_reason_wap_img.push(res.data.url);
|
||||
},
|
||||
getOrderDetail() {
|
||||
orderDetail(this.id)
|
||||
.then(res => {
|
||||
this.orderInfo = res.data;
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
getRefundReason() {
|
||||
getRefundReason().then(res => {
|
||||
this.reasonList = res.data;
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
const refund_reason_wap_explain = trim(this.refund_reason_wap_explain),
|
||||
text = this.reason;
|
||||
if (!text) {
|
||||
},
|
||||
getRefundReason() {
|
||||
getRefundReason().then(res => {
|
||||
this.reasonList = res.data;
|
||||
});
|
||||
},
|
||||
// 选择退款商品
|
||||
switchSelect (index) {
|
||||
let isAll = true
|
||||
this.selectProduct[index].checked = !this.selectProduct[index].checked
|
||||
this.selectProduct.forEach(item => {
|
||||
if (!item.checked) {
|
||||
isAll = false
|
||||
}
|
||||
})
|
||||
this.isAllSelect = isAll
|
||||
},
|
||||
// 全选
|
||||
allChecked () {
|
||||
this.isAllSelect = !this.isAllSelect
|
||||
this.selectProduct.forEach(item => {
|
||||
item.checked = this.isAllSelect
|
||||
})
|
||||
},
|
||||
// 选择退款类型
|
||||
chooseType (val) {
|
||||
this.selectProduct = this.selectProduct.map(item => {
|
||||
if (item.checked) {
|
||||
this.productParamList.push({
|
||||
productId: item.productId
|
||||
})
|
||||
console.log(item.costPrice)
|
||||
this.totalMoney += parseFloat(item.truePrice)
|
||||
this.totalNum += 1
|
||||
return item
|
||||
}
|
||||
}).filter(r => r)
|
||||
this.selected = true;
|
||||
this.serviceType = val;
|
||||
},
|
||||
submit() {
|
||||
const refund_reason_wap_explain = trim(this.refund_reason_wap_explain);
|
||||
if (!this.reason) {
|
||||
uni.showToast({
|
||||
title: "请选择退款原因",
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return
|
||||
}
|
||||
submitAfterSealsOrder({
|
||||
orderCode: this.orderInfo.orderId,
|
||||
serviceType: this.serviceType,
|
||||
reasonForApplication: this.reason,
|
||||
applicationInstructions: refund_reason_wap_explain,
|
||||
applicationDescriptionPicture: this.refund_reason_wap_img.join(","),
|
||||
productParamList: this.productParamList
|
||||
}).then(res => {
|
||||
if (res.status === 200) {
|
||||
uni.showToast({
|
||||
title: "请选择退款原因",
|
||||
icon: 'none',
|
||||
title: res.msg,
|
||||
icon: "success",
|
||||
duration: 2000
|
||||
});
|
||||
return
|
||||
setTimeout(() => {
|
||||
this.$yrouter.push({ path: '/pages/order/ReturnList/index' });
|
||||
}, 1500)
|
||||
}
|
||||
postOrderRefund({
|
||||
text,
|
||||
uni: this.orderInfo.orderId,
|
||||
refund_reason_wap_img: this.refund_reason_wap_img.join(","),
|
||||
refund_reason_wap_explain
|
||||
})
|
||||
.then(res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "success",
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$yrouter.back();
|
||||
}, 1500);
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.id = this.$yroute.query.id || 0;
|
||||
this.getOrderDetail();
|
||||
this.getRefundReason();
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.apply-return{
|
||||
.selectProduct{
|
||||
margin-bottom: 180rpx;
|
||||
.selectContainer{
|
||||
padding: 20rpx 32rpx;
|
||||
background-color: #FFF;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.pictrue{
|
||||
.image{
|
||||
width: 180rpx;
|
||||
height: 180rpx;
|
||||
}
|
||||
}
|
||||
.content{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin-left: 16rpx;
|
||||
font-size: 24rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
.title{
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
text-overflow: ellipsis;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.skus{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
color: #999999;
|
||||
}
|
||||
.money{
|
||||
margin-top: 10rpx;
|
||||
display: flex;
|
||||
view{
|
||||
color: #EB3729;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.choose{
|
||||
width: 100%;
|
||||
padding: 20rpx 30rpx;
|
||||
background-color: #FFF;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
height: 180rpx;
|
||||
.checkTotal{
|
||||
height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
border-bottom: 2rpx solid #F3F4F5;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.total{
|
||||
display: flex;
|
||||
.proTotal{
|
||||
color: #666;
|
||||
}
|
||||
.moneyTotal{
|
||||
color: #333;
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.typeBtn{
|
||||
margin-top: 10rpx;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
.button{
|
||||
width: 160rpx;
|
||||
height: 60rpx;
|
||||
margin: 0 10rpx;
|
||||
line-height: 60rpx;
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
border-radius: 180rpx;
|
||||
}
|
||||
.def{
|
||||
color: #AAAAAA;
|
||||
border: 2rpx solid #DDDDDD;
|
||||
}
|
||||
.redBtn{
|
||||
color: #FFF;
|
||||
background-color: #EB3729;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
39
pages/order/GoodsReturn/productlist.vue
Normal file
39
pages/order/GoodsReturn/productlist.vue
Normal file
@ -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>
|
@ -4,7 +4,7 @@
|
||||
<view class="header bg-color-red acea-row row-middle" :class="refundOrder ? 'on' : ''">
|
||||
<view class="data" :class="refundOrder ? 'on' : ''">
|
||||
<view class="state">{{ orderInfo._status._msg }}</view>
|
||||
<view>{{ orderInfo.createTime }}</view>
|
||||
<view>{{ orderInfo.createTime || '' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="!refundOrder">
|
||||
@ -24,14 +24,18 @@
|
||||
: 'icon-yuandianxiao',
|
||||
status.type >= 0 ? 'font-color-red' : ''
|
||||
]"></view>
|
||||
<view class="line" :class="{ 'bg-color-red': status.type > 0 && status.type != 9 }"></view>
|
||||
<view class="line" :class="{
|
||||
'bg-color-red': status.type > 0 && status.type != 9
|
||||
}"></view>
|
||||
<view class="iconfont" :class="[
|
||||
status.type === 1 ? 'icon-webicon318' : 'icon-yuandianxiao',
|
||||
status.type >= 1 && status.type != 6 && status.type != 9
|
||||
? 'font-color-red'
|
||||
: ''
|
||||
]"></view>
|
||||
<view class="line" :class="{'bg-color-red':status.type > 1 && status.type != 6 && status.type != 9}"
|
||||
<view class="line" :class="{
|
||||
'bg-color-red':status.type > 1 && status.type != 6 && status.type != 9
|
||||
}"
|
||||
v-if="orderInfo.shippingType === 1"></view>
|
||||
<view class="iconfont"
|
||||
:class="[status.type === 2 ? 'icon-webicon318' : 'icon-yuandianxiao',status.type >= 2 && status.type != 6 && status.type != 9? 'font-color-red': '']"
|
||||
@ -47,8 +51,7 @@
|
||||
: ''
|
||||
]"></view>
|
||||
<view class="line" :class="{
|
||||
'bg-color-red':
|
||||
status.type > 3 && status.type != 6 && status.type != 9
|
||||
'bg-color-red': status.type > 3 && status.type != 6 && status.type != 9
|
||||
}"></view>
|
||||
<view class="iconfont" :class="[
|
||||
status.type == 4 ? 'icon-webicon318' : 'icon-yuandianxiao',
|
||||
@ -97,7 +100,10 @@
|
||||
<view class="name">
|
||||
{{ orderInfo.realName }}
|
||||
<text class="phone">{{ orderInfo.userPhone }}</text>
|
||||
<text @click="telPhone(orderInfo.userPhone)" class="iconfont icon-tonghua font-color-red"></text>
|
||||
<text
|
||||
@click="telPhone(orderInfo.userPhone)"
|
||||
class="iconfont icon-tonghua font-color-red"
|
||||
></text>
|
||||
</view>
|
||||
<view>{{ orderInfo.userAddress }}</view>
|
||||
</view>
|
||||
@ -105,8 +111,9 @@
|
||||
<div class="name">
|
||||
{{ system_store.name}}
|
||||
<span class="phone">{{ system_store.phone }}</span>
|
||||
<span @click="telPhone(system_store.phone)" class="iconfont icon-tonghua font-color-red"
|
||||
:href="'tel:' + system_store.phone"></span>
|
||||
<span @click="telPhone(system_store.phone)"
|
||||
class="iconfont icon-tonghua font-color-red"
|
||||
:href="'tel:' + system_store.phone"></span>
|
||||
</div>
|
||||
<div>{{ system_store.address }}</div>
|
||||
</div>
|
||||
@ -114,24 +121,28 @@
|
||||
<image :src="`${$VUE_APP_RESOURCES_URL}/images/line.jpg`" />
|
||||
</view>
|
||||
</template>
|
||||
<OrderGoods :evaluate="status.type || 0" :isIntegral="isIntegral" :cartInfo="orderInfo.cartInfo || []"></OrderGoods>
|
||||
<OrderGoods
|
||||
:evaluate="status.type || 0"
|
||||
:isIntegral="isIntegral"
|
||||
:cartInfo="orderInfo.cartInfo || []"
|
||||
></OrderGoods>
|
||||
<view class="wrapper">
|
||||
<view class="item acea-row row-between">
|
||||
<view>订单编号:</view>
|
||||
<view class="conter acea-row row-middle row-right">
|
||||
{{ orderInfo.orderId }}
|
||||
<!-- #ifndef H5 -->
|
||||
<text class="copy copy-data" @click="copyClipboard(orderInfo.orderId)">复制</text>
|
||||
<!-- #endif -->
|
||||
{{ orderInfo.orderId || '' }}
|
||||
<!-- #ifndef H5 -->
|
||||
<text class="copy copy-data" @click="copyClipboard(orderInfo.orderId)">复制</text>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between">
|
||||
<view>下单时间:</view>
|
||||
<view class="conter">{{ orderInfo.createTime }}</view>
|
||||
<view class="conter">{{ orderInfo.createTime || '' }}</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between">
|
||||
<view>订单类型:</view>
|
||||
<view class="conter">{{ orderTypeName }}</view>
|
||||
<view class="conter">{{ orderTypeName || '' }}</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between">
|
||||
<view>支付状态:</view>
|
||||
@ -139,11 +150,11 @@
|
||||
</view>
|
||||
<view class="item acea-row row-between">
|
||||
<view>支付方式:</view>
|
||||
<view class="conter">{{ orderInfo._status._payType }}</view>
|
||||
<view class="conter">{{ orderInfo._status._payType || '' }}</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between" v-if="orderInfo.mark">
|
||||
<view>买家留言:</view>
|
||||
<view class="conter">{{ orderInfo.mark }}</view>
|
||||
<view class="conter">{{ orderInfo.mark || '' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -185,42 +196,42 @@
|
||||
<view class="wrapper" v-if="refundOrder">
|
||||
<view class="item acea-row row-between">
|
||||
<view>收货人:</view>
|
||||
<view class="conter">{{ orderInfo.realName }}</view>
|
||||
<view class="conter">{{ orderInfo.realName || '' }}</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between">
|
||||
<view>联系电话:</view>
|
||||
<view class="conter">{{ orderInfo.userPhone }}</view>
|
||||
<view class="conter">{{ orderInfo.userPhone || '' }}</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between">
|
||||
<view>收货地址:</view>
|
||||
<view class="conter">{{ orderInfo.userAddress }}</view>
|
||||
<view class="conter">{{ orderInfo.userAddress || '' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wrapper">
|
||||
<view class="item acea-row row-between" v-if="!isIntegral">
|
||||
<view>支付金额:</view>
|
||||
<view class="conter">¥{{ orderInfo.totalPrice }}</view>
|
||||
<view class="conter">¥{{ orderInfo.totalPrice || 0 }}</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between" v-if="isIntegral">
|
||||
<view>支付积分:</view>
|
||||
<view class="conter">{{ orderInfo.payIntegral }}积分</view>
|
||||
<view class="conter">{{ orderInfo.payIntegral || 0 }}积分</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between" v-if="orderInfo.couponPrice > 0">
|
||||
<view>优惠券抵扣:</view>
|
||||
<view class="conter">-¥{{ orderInfo.couponPrice }}</view>
|
||||
<view class="conter">-¥{{ orderInfo.couponPrice ||0 }}</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between" v-if="orderInfo.useIntegral > 0">
|
||||
<view>积分抵扣:</view>
|
||||
<view class="conter">-¥{{ orderInfo.deductionPrice }}</view>
|
||||
<view class="conter">-¥{{ orderInfo.deductionPrice || 0 }}</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between" v-if="orderInfo.payPostage > 0">
|
||||
<view>运费:</view>
|
||||
<view class="conter">¥{{ orderInfo.payPostage }}</view>
|
||||
<view class="conter">¥{{ orderInfo.payPostage || 0 }}</view>
|
||||
</view>
|
||||
<view class="actualPay acea-row row-right">
|
||||
实付款:
|
||||
<text class="money font-color-red" v-if="!isIntegral">¥{{ orderInfo.payPrice }}</text>
|
||||
<text class="money font-color-red" v-if="isIntegral">{{ orderInfo.payIntegral }}积分</text>
|
||||
<text class="money font-color-red" v-if="!isIntegral">¥{{ orderInfo.payPrice || 0 }}</text>
|
||||
<text class="money font-color-red" v-if="isIntegral">{{ orderInfo.payIntegral || 0 }}积分</text>
|
||||
</view>
|
||||
</view>
|
||||
<view style="height:100rpx;" v-if="!refundOrder && offlineStatus"></view>
|
||||
@ -229,13 +240,19 @@
|
||||
<view class="bnt cancel" @click="cancelOrder">取消订单</view>
|
||||
<view class="bnt bg-color-red" @click="pay = true">立即付款</view>
|
||||
</template>
|
||||
<template v-if="status.type == 1">
|
||||
<view class="bnt cancel" @click="goGoodsReturn(orderInfo)">申请退款</view>
|
||||
<template v-if="orderInfo.refundStatus === 0 && orderInfo.paid === 1">
|
||||
<view class="bnt cancel" @click="goGoodsReturn(orderInfo)">申请售后</view>
|
||||
</template>
|
||||
<!-- -->
|
||||
<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 bg-color-red" @click="takeOrder">确认收货</view>
|
||||
</template>
|
||||
<template v-if="orderInfo.shippingType == 1 && status.type == 3 && orderInfo.deliveryType == 'express'">
|
||||
@ -252,10 +269,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>
|
||||
@ -325,6 +352,7 @@
|
||||
},
|
||||
methods: {
|
||||
copyClipboard,
|
||||
// 申请退款
|
||||
goGoodsReturn(orderInfo) {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/order/GoodsReturn/index",
|
||||
@ -494,7 +522,6 @@
|
||||
},
|
||||
async toPay(type) {
|
||||
var that = this;
|
||||
console.log(type, "支付方式");
|
||||
await payOrderHandle(this.orderInfo.orderId, type, that.from);
|
||||
that.getDetail();
|
||||
},
|
||||
|
334
pages/order/OrderReturnDetail/index.vue
Normal file
334
pages/order/OrderReturnDetail/index.vue
Normal file
@ -0,0 +1,334 @@
|
||||
<template>
|
||||
<view class="returnList">
|
||||
<view class="data bgRed">
|
||||
<view v-if="orderDetail.salesState === 0">
|
||||
<view class="state" v-if="orderDetail.state === 0">
|
||||
已提交申请,请耐心等待卖家处理
|
||||
</view>
|
||||
<view class="state" v-if="orderDetail.state === 1">
|
||||
<view class="state" v-if="orderDetail.serviceType === 0">
|
||||
已通过平台审核,正在退款
|
||||
</view>
|
||||
<view class="state" v-if="orderDetail.serviceType === 1">
|
||||
已通过平台审核 ,请填写退货物流
|
||||
</view>
|
||||
</view>
|
||||
<view class="state" v-if="orderDetail.state === 2">
|
||||
已发货,等待商家审核
|
||||
</view>
|
||||
<view class="state" v-if="orderDetail.state === 3">
|
||||
售后订单已完成
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="orderDetail.salesState === 1">
|
||||
已撤销售后订单
|
||||
</view>
|
||||
<view v-if="orderDetail.salesState === 2">
|
||||
商家已拒绝售后申请
|
||||
</view>
|
||||
</view>
|
||||
<!-- 退款总金额 -->
|
||||
<view class="money">
|
||||
<view class="top">
|
||||
<text>退款总金额</text>
|
||||
<text class="colorRed">¥{{ orderDetail.refundAmount || 0}}</text>
|
||||
</view>
|
||||
<view class="express" v-if="orderDetail.serviceType === 1">
|
||||
<view class="title">商家已同意退货申请,请尽快发货。</view>
|
||||
<view class="info people">
|
||||
收货人: {{ orderDetail.consignee || '' }}
|
||||
</view>
|
||||
<view class="info address">
|
||||
收货地址: {{ orderDetail.address || '' }}
|
||||
</view>
|
||||
<view class="info phone">
|
||||
收货电话: {{ orderDetail.phoneNumber || '' }}
|
||||
</view>
|
||||
</view>
|
||||
<!-- 退款信息 -->
|
||||
<view class="tips" v-if="orderDetail.state === 0">
|
||||
<text class="title">您已成功发起退款申请,请耐心等待商家处理</text>
|
||||
<view class="content">
|
||||
<view>· 卖家同意或超时未处理,系统将退款给您</view>
|
||||
<view>· 如果卖家拒绝,您可以修改退款申请后再次发起,卖家会重新处理</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 撤销 -->
|
||||
<!-- <view class="tips" v-if="orderDetail.serviceType === 1 && orderDetail.state >= 2">
|
||||
<text class="title">您已撤销售后申请</text>
|
||||
<view class="content">
|
||||
<view>· </view>
|
||||
<view>· </view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 商家拒接 -->
|
||||
<!-- <view class="tips" v-if="orderDetail.serviceType === 2 && orderDetail.state >= 2">
|
||||
<text class="title">卖家已拒绝</text>
|
||||
<view class="content">
|
||||
<view>· </view>
|
||||
<view>· </view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="bottom">
|
||||
<view class="btns redBtn"
|
||||
v-if="orderDetail.salesState === 0
|
||||
&& orderDetail.serviceType === 1
|
||||
&& orderDetail.state === 1"
|
||||
@click="toExpress"
|
||||
>填写物流</view>
|
||||
<view class="btns def"
|
||||
v-if="orderDetail.salesState === 0"
|
||||
@click="cancelReq"
|
||||
>撤销申请</view>
|
||||
<!-- <view class="btns redBtn" @click="editReq">修改申请</view>-->
|
||||
</view>
|
||||
</view>
|
||||
<!-- 退款信息 -->
|
||||
<view class="rebackInfo">
|
||||
<view class="top">
|
||||
退款信息
|
||||
</view>
|
||||
<view class="rebackItem"
|
||||
v-for="item in orderDetail.cartInfo"
|
||||
:key="item.id"
|
||||
>
|
||||
<image class="img" :src="item.productInfo.image" mode=""></image>
|
||||
<view class="info">
|
||||
<view class="productName">
|
||||
{{ item.productInfo.storeName }}
|
||||
</view>
|
||||
<view class="sku">
|
||||
{{ item.productInfo.attrInfo.sku }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<view class="reason">
|
||||
<view class="left">
|
||||
退款原因:
|
||||
</view>
|
||||
<view class="right">
|
||||
{{ orderDetail.reasons || '' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="reason">
|
||||
<view class="left">
|
||||
退款金额:
|
||||
</view>
|
||||
<view class="right">
|
||||
¥{{ orderDetail.refundAmount || 0 }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="reason">
|
||||
<view class="left">
|
||||
退款编号:
|
||||
</view>
|
||||
<view class="right">
|
||||
{{ orderDetail.id || '' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="reason">
|
||||
<view class="left">
|
||||
申请时间:
|
||||
</view>
|
||||
<view class="right">
|
||||
{{ orderDetail.createTime || '' }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import{
|
||||
getAfterSealsDetail,
|
||||
rebackAfterSeals
|
||||
} from '@/api/aftersales.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderId: '',
|
||||
id: '',
|
||||
orderInfo: {},
|
||||
orderDetail: {}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.orderId = this.$yroute.query.key
|
||||
this.id = this.$yroute.query.id
|
||||
this.getReturnDetail()
|
||||
},
|
||||
methods: {
|
||||
/** state售后状态 0已提交等待平台审核 1平台已审核 等待用户发货/退款 2 用户已发货 3已完成 */
|
||||
async getReturnDetail() {
|
||||
const res = await getAfterSealsDetail(this.orderId, this.id)
|
||||
if (res.status === 200) {
|
||||
this.orderDetail = res.data
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "订单异常",
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
});
|
||||
}
|
||||
},
|
||||
toExpress () {
|
||||
this.$yrouter.push({
|
||||
path: '/pages/order/submitExpress/index',
|
||||
query: {
|
||||
orderCode: this.orderId
|
||||
}
|
||||
})
|
||||
},
|
||||
// 撤销申请
|
||||
async cancelReq() {
|
||||
const res = await rebackAfterSeals(this.orderId, this.id)
|
||||
if (res.status === 200) {
|
||||
uni.showToast({
|
||||
title: "已撤销",
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$yrouter.back();
|
||||
}, 1500)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "撤销失败",
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
});
|
||||
}
|
||||
},
|
||||
// 修改申请
|
||||
editReq() {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang='scss'>
|
||||
$red: #EB3729;
|
||||
.returnList{
|
||||
.colorRed{
|
||||
color: $red;
|
||||
}
|
||||
.bgRed{
|
||||
background-color: $red;
|
||||
}
|
||||
.data{
|
||||
width: 100%;
|
||||
height: 150rpx;
|
||||
line-height: 150rpx;
|
||||
padding-left: 30rpx;
|
||||
color: #FFF;
|
||||
}
|
||||
.money{
|
||||
background-color: #FFF;
|
||||
.top{
|
||||
padding: 20rpx 30rpx;
|
||||
font-size: 30rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
border-bottom: 2rpx solid #F3F4F5;
|
||||
}
|
||||
.express{
|
||||
padding: 20rpx 30rpx;
|
||||
font-size: 26rpx;
|
||||
.title{
|
||||
color: #333333;
|
||||
}
|
||||
.info{
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
.tips{
|
||||
height: 160rpx;
|
||||
padding: 20rpx 30rpx;
|
||||
color: #999999;
|
||||
border-bottom: 2rpx solid #F3F4F5;
|
||||
font-size: 26rpx;
|
||||
.title{
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.content{
|
||||
font-size: 20rpx;
|
||||
}
|
||||
}
|
||||
.bottom{
|
||||
padding: 20rpx 30rpx;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
.btns{
|
||||
width: 160rpx;
|
||||
height: 58rpx;
|
||||
margin: 0 10rpx;
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
line-height: 58rpx;
|
||||
border-radius: 180rpx;
|
||||
}
|
||||
.def{
|
||||
color: #DDDDDD;
|
||||
border: 2rpx solid #DDDDDD;
|
||||
}
|
||||
.redBtn{
|
||||
color: #FFF;
|
||||
background-color: $red;
|
||||
}
|
||||
}
|
||||
}
|
||||
.rebackInfo{
|
||||
padding: 0 30rpx;
|
||||
background-color: #FFF;
|
||||
.top{
|
||||
height: 80rpx;
|
||||
margin: 20rpx 0;
|
||||
line-height: 80rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
border-bottom: 2rpx solid #F3F4F5;
|
||||
}
|
||||
.rebackItem{
|
||||
padding: 20rpx 0;
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
border-bottom: 2rpx solid #F3F4F5;
|
||||
.img{
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
}
|
||||
.info{
|
||||
margin-left: 16rpx;
|
||||
flex: 1;
|
||||
.productName{
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: #333333;
|
||||
}
|
||||
.sku{
|
||||
font-size: 24rpx;
|
||||
color: #CCCCCC;
|
||||
}
|
||||
}
|
||||
}
|
||||
.bottom{
|
||||
padding: 20rpx 0;
|
||||
.reason{
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.right{
|
||||
color: #AAAAAA;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -21,23 +21,23 @@
|
||||
</view>
|
||||
<view class="iconfont icon-jiantou"></view>
|
||||
</view>
|
||||
<div class="address acea-row row-between-wrapper" v-if="shipping_type === 1" @click="showStoreList">
|
||||
<div class="addressCon" v-if="storeItems">
|
||||
<div class="name">
|
||||
<view class="address acea-row row-between-wrapper" v-if="shipping_type === 1" @click="showStoreList">
|
||||
<view class="addressCon" v-if="storeItems">
|
||||
<view class="name">
|
||||
{{ storeItems.name }}
|
||||
<span class="phone">{{ storeItems.phone }}</span>
|
||||
</div>
|
||||
<div>{{ storeItems.address }}</div>
|
||||
</div>
|
||||
<div class="addressCon" v-else>
|
||||
<div class="name">
|
||||
</view>
|
||||
<view>{{ storeItems.address }}</view>
|
||||
</view>
|
||||
<view class="addressCon" v-else>
|
||||
<view class="name">
|
||||
{{ systemStore.name }}
|
||||
<span class="phone">{{ systemStore.phone }}</span>
|
||||
</div>
|
||||
<div>{{ systemStore.address }}</div>
|
||||
</div>
|
||||
<div class="iconfont icon-jiantou"></div>
|
||||
</div>
|
||||
</view>
|
||||
<view>{{ systemStore.address }}</view>
|
||||
</view>
|
||||
<view class="iconfont icon-jiantou"></view>
|
||||
</view>
|
||||
<view class="line">
|
||||
<image :src="`${$VUE_APP_RESOURCES_URL}/images/line.jpg`" />
|
||||
</view>
|
||||
@ -312,9 +312,9 @@ export default {
|
||||
},
|
||||
onLoad: function() {
|
||||
let that = this
|
||||
console.log('loadddddddd')
|
||||
this.$store.dispatch('getUser', true)
|
||||
that.getCartInfo()
|
||||
|
||||
console.log(that.$yroute)
|
||||
if (that.$yroute.query.pinkid !== undefined) {
|
||||
that.pinkId = that.$yroute.query.pinkid
|
||||
@ -355,6 +355,7 @@ export default {
|
||||
}
|
||||
this.useIntegral = e.mp.detail.value[0]
|
||||
},
|
||||
// 计算商品价格
|
||||
computedPrice() {
|
||||
let shipping_type = this.shipping_type
|
||||
postOrderComputed(this.orderGroupInfo.orderKey, {
|
||||
@ -377,7 +378,11 @@ export default {
|
||||
})
|
||||
},
|
||||
getCartInfo() {
|
||||
const cartIds = this.$yroute.query.id
|
||||
let cartIds = this.$yroute.query.id
|
||||
// 拼团id
|
||||
if (this.$yroute.query.pinkId) {
|
||||
cartIds = this.$yroute.query.pinkId
|
||||
}
|
||||
if (!cartIds) {
|
||||
uni.showToast({
|
||||
title: '参数有误',
|
||||
@ -388,8 +393,6 @@ export default {
|
||||
}
|
||||
postOrderConfirm(cartIds)
|
||||
.then(res => {
|
||||
console.log(res, 999999)
|
||||
console.log(res.data.systemStore || {}, 999999)
|
||||
this.offlinePayStatus = res.data.offline_pay_status
|
||||
this.orderGroupInfo = res.data
|
||||
this.deduction = res.data.deduction
|
||||
|
@ -1,38 +1,25 @@
|
||||
<template>
|
||||
<view class="return-list" ref="container">
|
||||
<view class="goodWrapper" v-for="(order,orderListIndex) in orderList" :key="orderListIndex">
|
||||
<view class="iconfont icon-tuikuanzhong powder" v-if="order._status._type === -1"></view>
|
||||
<view class="iconfont icon-yituikuan" v-if="order._status._type === -2"></view>
|
||||
<view class="orderNum">订单号:{{ order.orderId }}</view>
|
||||
<view
|
||||
class="item acea-row row-between-wrapper"
|
||||
v-for="(cart,cartInfoIndex) in order.cartInfo"
|
||||
:key="cartInfoIndex"
|
||||
@click="goOrderDetails(order)"
|
||||
>
|
||||
<view class="pictrue">
|
||||
<image :src="cart.productInfo.image" class="image" @click.stop="goGoodsCon(cart)" />
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="acea-row row-between-wrapper">
|
||||
<view class="name line1">{{ cart.productInfo.storeName }}</view>
|
||||
<view class="num">x {{ cart.cartNum }}</view>
|
||||
</view>
|
||||
<view
|
||||
class="attr line1"
|
||||
v-if="cart.productInfo.attrInfo"
|
||||
>{{ cart.productInfo.attrInfo.sku }}</view>
|
||||
<view class="attr line1" v-else>{{ cart.productInfo.storeName }}</view>
|
||||
<view class="money">¥{{ cart.productInfo.price }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="totalSum">
|
||||
共{{ order.cartInfo.length || 0 }}件商品,总金额
|
||||
<text
|
||||
class="font-color-red price"
|
||||
>¥{{ order.payPrice }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 分类查询 -->
|
||||
<view class="nav">
|
||||
<view class="item" :class="{ on: listQuery.type === 0 }" @click="changeType(0)">
|
||||
<view>全部</view>
|
||||
</view>
|
||||
<view class="item" :class="{ on: listQuery.type === 1 }" @click="changeType(1)">
|
||||
<view>售后中</view>
|
||||
</view>
|
||||
<view class="item" :class="{ on: listQuery.type === 2 }" @click="changeType(2)">
|
||||
<view>已完成</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 商品列表 -->
|
||||
<view class="list">
|
||||
<ListItem
|
||||
v-for="(item,index) in orderList"
|
||||
:key="index"
|
||||
:item="item"
|
||||
/>
|
||||
</view>
|
||||
<view class="noCart" v-if="orderList.length === 0 && page > 1">
|
||||
<view class="pictrue">
|
||||
<image :src="`${$VUE_APP_RESOURCES_URL}/images/noOrder.png`" />
|
||||
@ -44,56 +31,81 @@
|
||||
|
||||
<script>
|
||||
import { getOrderList } from "@/api/order";
|
||||
import { getAfterSealsList } from "@/api/aftersales.js";
|
||||
import Loading from "@/components/Loading";
|
||||
import ListItem from './listItem.vue'
|
||||
|
||||
export default {
|
||||
name: "ReturnList",
|
||||
components: {
|
||||
Loading
|
||||
Loading,
|
||||
ListItem
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
orderList: [],
|
||||
page: 1,
|
||||
limit: 20,
|
||||
loading: false,
|
||||
loaded: false
|
||||
orderList: [],
|
||||
listQuery: {
|
||||
page: 1,
|
||||
limit: 5,
|
||||
type: 0
|
||||
},
|
||||
type: 0,
|
||||
loading: false,
|
||||
loaded: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
goGoodsCon(cart) {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/shop/GoodsCon/index",
|
||||
query: { id: cart.productInfo.id }
|
||||
});
|
||||
},
|
||||
goOrderDetails(order) {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/order/OrderDetails/index",
|
||||
query: { id: order.orderId }
|
||||
});
|
||||
},
|
||||
getOrderList() {
|
||||
const { page, limit } = this;
|
||||
if (this.loading || this.loaded) return;
|
||||
this.loading = true;
|
||||
getOrderList({
|
||||
page,
|
||||
limit,
|
||||
type: -3
|
||||
}).then(res => {
|
||||
this.orderList = this.orderList.concat(res.data);
|
||||
this.loading = false;
|
||||
this.loaded = res.data.length < limit;
|
||||
this.page++;
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getOrderList();
|
||||
},
|
||||
onReachBottom() {
|
||||
!this.loading && this.getOrderList();
|
||||
},
|
||||
methods: {
|
||||
// 售后详情
|
||||
getOrderList() {
|
||||
if ((this.loading || this.loaded) && (this.type === this.listQuery.type)) return;
|
||||
this.loading = true;
|
||||
// 售后接口
|
||||
getAfterSealsList(this.listQuery).then(res => {
|
||||
// console.log(res)
|
||||
if (this.type === this.listQuery.type) {
|
||||
this.orderList = [...this.orderList, ...res.data];
|
||||
} else {
|
||||
this.orderList = res.data;
|
||||
this.type = this.listQuery.type
|
||||
}
|
||||
this.listQuery.page++;
|
||||
// 加载组件
|
||||
this.loading = false;
|
||||
this.loaded = res.data.length < this.listQuery.limit;// 查询到末尾
|
||||
})
|
||||
},
|
||||
// 分类查询
|
||||
changeType (type) {
|
||||
this.listQuery.type = type
|
||||
this.listQuery.page = 1;
|
||||
this.getOrderList()
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.return-list{
|
||||
.nav{
|
||||
background-color: #FFF;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
.item{
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
font-size: 14px;
|
||||
font-family: PingFang SC;
|
||||
color: #333333;
|
||||
}
|
||||
.on{
|
||||
border-bottom: 6rpx solid #EB3729;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
184
pages/order/ReturnList/listItem.vue
Normal file
184
pages/order/ReturnList/listItem.vue
Normal file
@ -0,0 +1,184 @@
|
||||
<!-- 售后列表内容 -->
|
||||
<template>
|
||||
<view class="productItem">
|
||||
<view class="title">
|
||||
<view class="shopName">
|
||||
订单号:{{ item.orderCode }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="content" v-for="(i, index) in item.cartInfo">
|
||||
<image class="img"
|
||||
:src="i.productInfo.image"
|
||||
mode=""
|
||||
@click.stop="goGoodsCon(i)"
|
||||
></image>
|
||||
<view class="info">
|
||||
<view class="infoTitle">
|
||||
{{ i.productInfo.storeName }}
|
||||
</view>
|
||||
<view class="infoSku">
|
||||
<view class="sku">
|
||||
{{ i.productInfo.attrInfo.sku || '' }}
|
||||
</view>
|
||||
<view class="num">
|
||||
x {{ 1 }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="infoMoney">
|
||||
退款:<view class="red">
|
||||
¥{{ i.productInfo.price }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="money">
|
||||
<view class="status">
|
||||
<view v-if="item.salesState === 0">
|
||||
<view v-if="item.state === 0">商家处理中</view>
|
||||
<view v-if="item.state === 1">售后中</view>
|
||||
<view v-if="item.state === 2">等待商家收货</view>
|
||||
<view v-if="item.state === 3">已完成</view>
|
||||
</view>
|
||||
<view v-if="item.salesState === 1">
|
||||
已撤销
|
||||
</view>
|
||||
<view v-if="item.salesState === 2">
|
||||
商家拒绝
|
||||
</view>
|
||||
</view>
|
||||
<view class="refundMoney">
|
||||
退款:<view class="red">
|
||||
¥{{ item.refundAmount }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btns">
|
||||
<view class="button def"
|
||||
@click="toDetail"
|
||||
v-if="item.state === 2"
|
||||
>删除记录</view>
|
||||
<view class="button redBtn" @click="toDetail(item)">查看详情</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
deleteAfterSeals
|
||||
} from '@/api/aftersales.js'
|
||||
export default {
|
||||
props: {
|
||||
item: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
// 跳转商品
|
||||
goGoodsCon(item) {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/shop/GoodsCon/index",
|
||||
query: { id: item.productInfo.id }
|
||||
});
|
||||
},
|
||||
// 跳转售后详情
|
||||
toDetail (item) {
|
||||
console.log(item)
|
||||
this.$yrouter.push({
|
||||
path: "/pages/order/OrderReturnDetail/index",
|
||||
query: {
|
||||
key: item.orderCode,
|
||||
id: item.id
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.productItem{
|
||||
margin: 10rpx 0;
|
||||
background-color: #FFF;
|
||||
.title{
|
||||
height: 80rpx;
|
||||
padding: 0 30rpx;
|
||||
color: #333;
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.content{
|
||||
padding: 20rpx 30rpx;
|
||||
border: 2rpx solid #F3F4F5;
|
||||
display: flex;
|
||||
.img{
|
||||
width: 180rpx;
|
||||
height: 180rpx;
|
||||
}
|
||||
.info{
|
||||
flex: 1;
|
||||
margin-left: 16rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
.infoTitle{
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.infoSku{
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.infoMoney{
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.money{
|
||||
height: 80rpx;
|
||||
padding: 0 30rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC;
|
||||
color: #333333;
|
||||
border: 2rpx solid #F3F4F5;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.btns{
|
||||
padding: 20rpx 30rpx;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
.button{
|
||||
width: 160rpx;
|
||||
height: 58rpx;
|
||||
margin: 0 10rpx;
|
||||
border-radius: 180rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 54rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.def{
|
||||
color: #DDD;
|
||||
border: 2rpx solid #DDDDDD;
|
||||
}
|
||||
.redBtn{
|
||||
color: #FFF;
|
||||
background-color: #EB3729;
|
||||
border: 2rpx solid #EB3729;
|
||||
}
|
||||
}
|
||||
.red{
|
||||
display: inline-block;
|
||||
color: #EB3729;
|
||||
}
|
||||
}
|
||||
</style>
|
174
pages/order/submitExpress/index.vue
Normal file
174
pages/order/submitExpress/index.vue
Normal file
@ -0,0 +1,174 @@
|
||||
<!-- 提交物流 -->
|
||||
<template>
|
||||
<view class="submitExpress">
|
||||
<!-- 填写物流 -->
|
||||
<view class="form">
|
||||
<picker class="picker"
|
||||
:value="express"
|
||||
:range="expressPicker"
|
||||
@change="changeExpress"
|
||||
>
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view class="title">
|
||||
<view class="point">
|
||||
*
|
||||
</view>
|
||||
物流公司
|
||||
</view>
|
||||
<view class="num">{{ express }}</view>
|
||||
<text class="iconfont icon-jiantou"></text>
|
||||
</view>
|
||||
</picker>
|
||||
<view class="item">
|
||||
<view class="title">
|
||||
<view class="point">
|
||||
*
|
||||
</view>
|
||||
物流单号:
|
||||
</view>
|
||||
<input class="input" v-model="expressQuery.postalCode" placeholder="请输入物流单号" />
|
||||
</view>
|
||||
</view>
|
||||
<!-- 提交按钮 -->
|
||||
<view class="btnContainer">
|
||||
<view class="addBtn" @click="addExpress">
|
||||
提交
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getExpressData,
|
||||
addExpressData
|
||||
} from '@/api/aftersales.js'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
expressQuery: {
|
||||
code: '', // 快递公司编码
|
||||
name: '', // 快递公司名称
|
||||
postalCode: 'SF1213132132', // 快递编号
|
||||
orderCode: '' // 订单编号
|
||||
},
|
||||
expressList: [],
|
||||
expressPicker: [],
|
||||
express: ''
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.expressQuery.orderCode = this.$yroute.query.orderCode
|
||||
this.getExpress()
|
||||
},
|
||||
methods: {
|
||||
async getExpress () {
|
||||
const res = await getExpressData()
|
||||
console.log(res)
|
||||
this.expressList = res.data.map(item => {
|
||||
return {
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
code: item.code
|
||||
}
|
||||
})
|
||||
this.expressPicker = res.data.map(item => {
|
||||
return item.name
|
||||
})
|
||||
},
|
||||
changeExpress(e) {
|
||||
this.express = this.expressPicker[e.mp.detail.value];
|
||||
this.expressQuery.code = this.expressList[e.mp.detail.value].code
|
||||
this.expressQuery.name = this.expressList[e.mp.detail.value].name
|
||||
},
|
||||
async addExpress () {
|
||||
let errMsg = '请选择'
|
||||
if (!this.expressQuery.code || !this.expressQuery.code) {
|
||||
errMsg += ' 快递公司 '
|
||||
}
|
||||
if (!this.expressQuery.postalCode) {
|
||||
errMsg += ' 快递单号 '
|
||||
}
|
||||
if (errMsg.length > 3) {
|
||||
uni.showToast({
|
||||
title: errMsg,
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
})
|
||||
}
|
||||
console.log(this.expressQuery)
|
||||
const res = await addExpressData(this.expressQuery)
|
||||
if (res.status === 200) {
|
||||
uni.showToast({
|
||||
title: '物流填写成功!',
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
})
|
||||
this.$yrouter.push({
|
||||
path: '/pages/order/ReturnList/index'
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '提交物流信息失败!',
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.submitExpress{
|
||||
.form{
|
||||
margin-bottom: 170rpx;
|
||||
.picker{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
.item{
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
padding: 0 32rpx;
|
||||
line-height: 80rpx;
|
||||
background-color: #FFF;
|
||||
display: flex;
|
||||
.title{
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
display: flex;
|
||||
.point{
|
||||
color: #EA3729;
|
||||
}
|
||||
}
|
||||
.input{
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
.btnContainer{
|
||||
width: 100%;
|
||||
height: 170rpx;
|
||||
background-color: #FFF;
|
||||
box-shadow: 0px 0px 0px rgba(197, 202, 207, 0.5);
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
.addBtn{
|
||||
height: 90rpx;
|
||||
margin: 40rpx 30rpx;
|
||||
line-height: 90rpx;
|
||||
text-align: center;
|
||||
border-radius: 50rpx;
|
||||
font-size: 28rpx;
|
||||
color: #FFF;
|
||||
background: linear-gradient(90deg, #E93526 0%, #FF8E3C 100%);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -62,8 +62,12 @@
|
||||
</view>
|
||||
</view>
|
||||
<Loading :loaded="loaded" :loading="loading"></Loading>
|
||||
<PriceChange :change="change" :orderInfo="orderInfo" v-on:closechange="changeclose($event)" v-on:savePrice="savePrice"
|
||||
:status="status"></PriceChange>
|
||||
<PriceChange
|
||||
:change="change"
|
||||
:orderInfo="orderInfo"
|
||||
v-on:closechange="changeclose($event)"
|
||||
v-on:savePrice="savePrice"
|
||||
:status="status"></PriceChange>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -72,37 +72,34 @@ export default {
|
||||
!this.loading && this.getProductReplyList();
|
||||
},
|
||||
methods: {
|
||||
getProductReplyCount: function() {
|
||||
let that = this;
|
||||
getReplyConfig(that.product_id).then(res => {
|
||||
that.$set(that, "replyData", res.data);
|
||||
that.navList[0].num = res.data.sumCount;
|
||||
that.navList[1].num = res.data.goodCount;
|
||||
that.navList[2].num = res.data.inCount;
|
||||
that.navList[3].num = res.data.poorCount;
|
||||
getProductReplyCount () {
|
||||
getReplyConfig(this.product_id).then(res => {
|
||||
this.$set(that, "replyData", res.data);
|
||||
this.navList[0].num = res.data.sumCount;
|
||||
this.navList[1].num = res.data.goodCount;
|
||||
this.navList[2].num = res.data.inCount;
|
||||
this.navList[3].num = res.data.poorCount;
|
||||
});
|
||||
},
|
||||
getProductReplyList: function() {
|
||||
let that = this;
|
||||
if (that.loading) return; //阻止下次请求(false可以进行请求);
|
||||
if (that.loadend) return; //阻止结束当前请求(false可以进行请求);
|
||||
that.loading = true;
|
||||
let q = { page: that.page, limit: that.limit, type: that.currentActive };
|
||||
getReplyList(that.product_id, q).then(res => {
|
||||
that.loading = false;
|
||||
getProductReplyList () {
|
||||
if (this.loading) return; //阻止下次请求(false可以进行请求);
|
||||
if (this.loadend) return; //阻止结束当前请求(false可以进行请求);
|
||||
this.loading = true;
|
||||
let q = { page: this.page, limit: this.limit, type: this.currentActive };
|
||||
getReplyList(this.product_id, q).then(res => {
|
||||
this.loading = false;
|
||||
//apply();js将一个数组插入另一个数组;
|
||||
that.reply.push.apply(that.reply, res.data);
|
||||
that.loadend = res.data.length < that.limit; //判断所有数据是否加载完成;
|
||||
that.page = that.page + 1;
|
||||
this.reply.push.apply(this.reply, res.data);
|
||||
this.loadend = res.data.length < this.limit; //判断所有数据是否加载完成;
|
||||
this.page = this.page + 1;
|
||||
});
|
||||
},
|
||||
changeType: function(index) {
|
||||
let that = this;
|
||||
that.currentActive = index;
|
||||
that.page = 1;
|
||||
that.loadend = false;
|
||||
that.$set(that, "reply", []);
|
||||
that.getProductReplyList();
|
||||
changeType (index) {
|
||||
this.currentActive = index;
|
||||
this.page = 1;
|
||||
this.loadend = false;
|
||||
this.$set(this, "reply", []);
|
||||
this.getProductReplyList();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -108,7 +108,7 @@ export default {
|
||||
nows: false,
|
||||
recommendLoading: false,
|
||||
target: false,
|
||||
isIntegral: false,
|
||||
isIntegral: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -189,18 +189,19 @@ export default {
|
||||
this.stock = 0
|
||||
// this.getProductList();
|
||||
}
|
||||
let q = that.where
|
||||
let q = this.where
|
||||
let getData = this.isIntegral !== 'true' ? getProducts : getProductsIntegral
|
||||
getData(q).then(res => {
|
||||
that.loading = false
|
||||
if (that.target) {
|
||||
that.productList = res.data
|
||||
this.loading = false
|
||||
if (this.target) {
|
||||
this.productList = res.data
|
||||
this.target = false
|
||||
} else {
|
||||
that.productList.push.apply(that.productList, res.data)
|
||||
this.productList.push.apply(this.productList, res.data)
|
||||
}
|
||||
that.target = false
|
||||
that.loadend = res.data.length < that.where.limit //判断所有数据是否加载完成;
|
||||
that.where.page = that.where.page + 1
|
||||
console.log(this.target)
|
||||
this.loadend = res.data.length < this.where.limit //判断所有数据是否加载完成;
|
||||
this.where.page = this.where.page + 1
|
||||
})
|
||||
},
|
||||
submitForm: function() {
|
||||
@ -248,27 +249,25 @@ export default {
|
||||
that.getProductList()
|
||||
},
|
||||
//设置where条件
|
||||
setWhere: function() {
|
||||
let that = this
|
||||
if (that.price === 0) {
|
||||
that.where.priceOrder = ''
|
||||
} else if (that.price === 1) {
|
||||
that.where.priceOrder = 'asc'
|
||||
} else if (that.price === 2) {
|
||||
that.where.priceOrder = 'desc'
|
||||
setWhere() {
|
||||
if (this.price === 0) {
|
||||
this.where.priceOrder = ''
|
||||
} else if (this.price === 1) {
|
||||
this.where.priceOrder = 'asc'
|
||||
} else if (this.price === 2) {
|
||||
this.where.priceOrder = 'desc'
|
||||
}
|
||||
if (that.stock === 0) {
|
||||
that.where.salesOrder = ''
|
||||
} else if (that.stock === 1) {
|
||||
that.where.salesOrder = 'asc'
|
||||
} else if (that.stock === 2) {
|
||||
that.where.salesOrder = 'desc'
|
||||
if (this.stock === 0) {
|
||||
this.where.salesOrder = ''
|
||||
} else if (this.stock === 1) {
|
||||
this.where.salesOrder = 'asc'
|
||||
} else if (this.stock === 2) {
|
||||
this.where.salesOrder = 'desc'
|
||||
}
|
||||
that.where.news = that.nows ? '1' : '0'
|
||||
this.where.news = this.nows ? '1' : '0'
|
||||
},
|
||||
switchTap: function() {
|
||||
let that = this
|
||||
that.Switch = !that.Switch
|
||||
switchTap() {
|
||||
this.Switch = !this.Switch
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -520,5 +520,9 @@
|
||||
}
|
||||
.shoppingCart{
|
||||
position: relative;
|
||||
.list{
|
||||
margin-top: 150rpx;
|
||||
padding-top: 15rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -1,9 +1,12 @@
|
||||
<template>
|
||||
<view class="ChangePassword">
|
||||
<view class="phone">
|
||||
<!-- <view class="phone">
|
||||
当前手机号:
|
||||
<input type="text" v-model="phone" disabled />
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="title">
|
||||
通过手机号来修改密码:
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="item">
|
||||
<input type="password" placeholder="设置新密码" v-model="password" />
|
||||
@ -13,18 +16,13 @@
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
|
||||
<button class="code font-color-red" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">{{ text }}</button>
|
||||
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">{{ text }}</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="confirmBnt bg-color-red" @click="confirm">确认修改</view>
|
||||
</view>
|
||||
</template>
|
||||
<style scoped lang="less">
|
||||
.ChangePassword .phone input {
|
||||
width: 2 * 100rpx;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
// import { mapGetters } from "vuex";
|
||||
import sendVerifyCode from '@/mixins/SendVerifyCode'
|
||||
@ -84,13 +82,24 @@ export default {
|
||||
password: that.password,
|
||||
})
|
||||
.then(res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
})
|
||||
|
||||
// that.$yrouter.push({ path: "/pages/user/Login/index" });
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
})
|
||||
this.$yrouter.replace({
|
||||
path: "/pages/user/Login/index",
|
||||
query: {},
|
||||
});
|
||||
// getLogout()
|
||||
// .then((res) => {
|
||||
// this.$store.commit("logout");
|
||||
// this.$yrouter.replace({
|
||||
// path: "/pages/user/Login/index",
|
||||
// query: {},
|
||||
// });
|
||||
// })
|
||||
// .catch((err) => {});
|
||||
})
|
||||
.catch(res => {
|
||||
uni.showToast({
|
||||
@ -133,3 +142,27 @@ export default {
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.ChangePassword {
|
||||
.title{
|
||||
margin: 10rpx;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
.list{
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0 10%;
|
||||
background-color: #FFFFFF;
|
||||
.code{
|
||||
width: 30%;
|
||||
text-align: center;
|
||||
color: #FFFFFF;
|
||||
background-color: #f35749;
|
||||
padding: 12rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -1,57 +1,58 @@
|
||||
<template>
|
||||
<view class="register absolute">
|
||||
<view class="whiteBg" v-if="formItem === 1">
|
||||
<view class="title acea-row row-between-wrapper">
|
||||
<view class="title acea-row">
|
||||
<view class="item" :class="current === index ? 'on' : ''" v-for="(item, index) in navList"
|
||||
@click="navTap(index)" :key="index">{{ item }}</view>
|
||||
</view>
|
||||
<!-- 手机号登录 -->
|
||||
<view class="list" :hidden="current !== 0">
|
||||
<form @submit.prevent="submit">
|
||||
<view class="item">
|
||||
<view class="acea-row row-between-wrapper">
|
||||
<!-- <svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-phone_" />
|
||||
</svg>-->
|
||||
<input type="text" placeholder="输入手机号码" v-model="account" required />
|
||||
<view class="item getPhoneCode">
|
||||
<view class="phoneInput acea-row row-between-wrapper">
|
||||
<input type="text" placeholder="输入手机号码"
|
||||
v-model="account" required/>
|
||||
</view>
|
||||
<view class="phoneCode" @click="sendCode">
|
||||
{{ clockText }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="acea-row row-between-wrapper">
|
||||
<!-- <svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-code_" />
|
||||
</svg>-->
|
||||
<input type="password" placeholder="填写登录密码" v-model="password" required />
|
||||
<input type="text" placeholder="请输入验证码" v-model="captcha" required />
|
||||
<!-- <input type="password" placeholder="填写登录密码" v-model="password" required /> -->
|
||||
</view>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
<!-- 账号密码登录 -->
|
||||
<view class="list" :hidden="current !== 1">
|
||||
<view class="item">
|
||||
<view class="acea-row row-between-wrapper">
|
||||
<!-- <svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-phone_" />
|
||||
</svg>-->
|
||||
<input type="text" placeholder="输入手机号码" v-model="account" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="item">
|
||||
<view class="acea-row row-between-wrapper">
|
||||
<input type="password" placeholder="输入密码" v-model="password" />
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="item">
|
||||
<view class="align-left">
|
||||
<!-- <svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-code_1" />
|
||||
</svg>-->
|
||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
|
||||
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''"
|
||||
@click="code">{{ text }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="logon" @click="loginMobile" :hidden="current !== 1">登录</view>
|
||||
<view class="logon" @click="submit" :hidden="current === 1">登录</view>
|
||||
<view class="logon" @click="loginMobile" :hidden="current === 1">手机号登录</view>
|
||||
<view class="logon" @click="submit" :hidden="current !== 1">登录</view>
|
||||
<view class="tip">
|
||||
没有账号?
|
||||
第一次使用?
|
||||
<text @click="formItem = 2" class="font-color-red">立即注册</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 注册 -->
|
||||
<view class="whiteBg" v-else>
|
||||
<view class="title acea-row row-between-wrapper">
|
||||
<view class="item on">注册账号</view>
|
||||
@ -133,210 +134,278 @@
|
||||
mixins: [sendVerifyCode],
|
||||
data: function () {
|
||||
return {
|
||||
navList: ["账号登录"],
|
||||
navList: ["手机号登录", "密码登录"],
|
||||
// navList: ["手机号登录",],
|
||||
current: 0,
|
||||
account: "",
|
||||
password: "",
|
||||
captcha: "",
|
||||
inviteCode: "",
|
||||
formItem: 1,
|
||||
type: "login"
|
||||
type: "login",
|
||||
timer: null,
|
||||
clock: 60,
|
||||
clockText: '验证码'
|
||||
};
|
||||
},
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
});
|
||||
});
|
||||
}
|
||||
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);
|
||||
}
|
||||
const res = await loginMobile({
|
||||
account: that.account,
|
||||
captcha: that.captcha,
|
||||
spread: cookie.get("spread")
|
||||
})
|
||||
if (res.status === 200) {
|
||||
this.$store.commit("login", res.data.token, dayjs(res.data.expires_time));
|
||||
handleGetUserInfo();
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg || res.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
// .then(res => {
|
||||
// that.$store.commit("login", res.data.token, dayjs(res.data.expires_time));
|
||||
// handleGetUserInfo();
|
||||
// })
|
||||
// .catch(err => {
|
||||
// console.log(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() {
|
||||
const {
|
||||
account
|
||||
} = this;
|
||||
try {
|
||||
await this
|
||||
.$validator({
|
||||
account: [
|
||||
required(required.message("手机号码")),
|
||||
chs_phone(chs_phone.message())
|
||||
]
|
||||
})
|
||||
.validate({
|
||||
account
|
||||
});
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
if (this.formItem == 2) this.type = "register";
|
||||
this.showCode()
|
||||
},
|
||||
// 手机号登录获取验证码
|
||||
async sendCode () {
|
||||
const {
|
||||
account
|
||||
} = this;
|
||||
try {
|
||||
await this
|
||||
.$validator({
|
||||
account: [
|
||||
required(required.message("手机号码")),
|
||||
chs_phone(chs_phone.message())
|
||||
]
|
||||
})
|
||||
.validate({
|
||||
account
|
||||
});
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
// 倒计时
|
||||
if (this.clock !== 60) {
|
||||
return
|
||||
}
|
||||
this.clock--
|
||||
this.clockText = `${this.clock} 秒`
|
||||
this.timer = setInterval(() => {
|
||||
if (parseInt(this.clock) === 1) {
|
||||
clearTimeout(this.timer)
|
||||
this.clock = 60
|
||||
this.clockText = '获取验证码'
|
||||
return
|
||||
}
|
||||
this.clock--
|
||||
if (this.clock < 10) this.clock = `0${this.clock}`
|
||||
this.clockText = `${this.clock} 秒`
|
||||
}, 1000)
|
||||
this.showCode()
|
||||
},
|
||||
// 验证码请求
|
||||
showCode() {
|
||||
return registerVerify({
|
||||
phone: this.account,
|
||||
type: this.type
|
||||
})
|
||||
.then(res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "success",
|
||||
duration: 2000
|
||||
});
|
||||
this.sendCode();
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
navTap(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);
|
||||
}
|
||||
// 账号密码登录
|
||||
const res = await login({
|
||||
username: account,
|
||||
password,
|
||||
spread: cookie.get("spread")
|
||||
})
|
||||
if (res.status === 200) {
|
||||
this.$store.commit("login", res.data.token, dayjs(res.data.expires_time));
|
||||
handleGetUserInfo();
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg || res.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.register .whiteBg .title .item{
|
||||
border-bottom: 2px solid;
|
||||
}
|
||||
.register .whiteBg .title .item.on{
|
||||
border-bottom-color: #f35749;
|
||||
}
|
||||
.getPhoneCode{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.phoneInput{
|
||||
width: 70%;
|
||||
}
|
||||
.phoneCode{
|
||||
width: 30%;
|
||||
text-align: center;
|
||||
color: #FFFFFF;
|
||||
background-color: #f35749;
|
||||
padding: 12rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
340
pages/user/Login/login.vue
Normal file
340
pages/user/Login/login.vue
Normal file
@ -0,0 +1,340 @@
|
||||
<template>
|
||||
<view class="register absolute">
|
||||
<view class="whiteBg" v-if="formItem === 1">
|
||||
<view class="title acea-row">
|
||||
<view class="item" :class="current === index ? 'on' : ''" v-for="(item, index) in navList"
|
||||
@click="navTap(index)" :key="index">{{ item }}</view>
|
||||
</view>
|
||||
<view class="list" :hidden="current !== 0">
|
||||
<form @submit.prevent="submit">
|
||||
<view class="item">
|
||||
<view class="acea-row row-between-wrapper">
|
||||
<!-- <svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-phone_" />
|
||||
</svg>-->
|
||||
<input type="text" placeholder="输入手机号码" v-model="account" required />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="acea-row row-between-wrapper">
|
||||
<!-- <svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-code_" />
|
||||
</svg>-->
|
||||
<input type="password" placeholder="填写登录密码" v-model="password" required />
|
||||
</view>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
<view class="list" :hidden="current !== 1">
|
||||
<view class="item">
|
||||
<view class="acea-row row-between-wrapper">
|
||||
<!-- <svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-phone_" />
|
||||
</svg>-->
|
||||
<input type="text" placeholder="输入手机号码" v-model="account" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="align-left">
|
||||
<!-- <svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-code_1" />
|
||||
</svg>-->
|
||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
|
||||
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''"
|
||||
@click="code">{{ text }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="logon" @click="loginMobile" :hidden="current !== 1">登录</view>
|
||||
<view class="logon" @click="submit" :hidden="current === 1">登录</view>
|
||||
<view class="tip">
|
||||
没有账号?
|
||||
<text @click="formItem = 2" class="font-color-red">立即注册</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 注册 -->
|
||||
<view class="whiteBg" v-else>
|
||||
<view class="title acea-row row-between-wrapper">
|
||||
<view class="item on">注册账号</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="item">
|
||||
<view>
|
||||
<!-- <svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-phone_" />
|
||||
</svg>-->
|
||||
<input name="account" type="text" placeholder="输入手机号码" v-model="account" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="align-left">
|
||||
<!-- <svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-code_1" />
|
||||
</svg>-->
|
||||
<input name="verifyCode" type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
|
||||
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''"
|
||||
@click="code">{{ text }}</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view>
|
||||
<!-- <svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-code_" />
|
||||
</svg>-->
|
||||
<input name="password" type="password" placeholder="填写您的登录密码" v-model="password" />
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifndef H5 -->
|
||||
<view class="item">
|
||||
<view>
|
||||
<!-- <svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-phone_" />
|
||||
</svg>-->
|
||||
<input name="inviteCode" type="text" placeholder="输入邀请码" v-model="inviteCode" />
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
</view>
|
||||
<view class="logon" @click="register">注册</view>
|
||||
<view class="tip">
|
||||
已有账号?
|
||||
<text @click="formItem = 1" class="font-color-red">立即登录</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import sendVerifyCode from "@/mixins/SendVerifyCode";
|
||||
import {
|
||||
login,
|
||||
loginMobile,
|
||||
registerVerify,
|
||||
register
|
||||
} from "@/api/user";
|
||||
import attrs, {
|
||||
required,
|
||||
alpha_num,
|
||||
chs_phone
|
||||
} from "@/utils/validate";
|
||||
import {
|
||||
validatorDefaultCatch
|
||||
} from "@/utils/dialog";
|
||||
import dayjs from "dayjs";
|
||||
import cookie from "@/utils/store/cookie";
|
||||
|
||||
import {
|
||||
handleGetUserInfo
|
||||
} from "@/utils";
|
||||
|
||||
const BACK_URL = "login_back_url";
|
||||
|
||||
export default {
|
||||
name: "Login",
|
||||
mixins: [sendVerifyCode],
|
||||
data: function () {
|
||||
return {
|
||||
navList: ["账号登录", "修改密码"],
|
||||
current: 0,
|
||||
account: "",
|
||||
password: "",
|
||||
captcha: "",
|
||||
inviteCode: "",
|
||||
formItem: 1,
|
||||
type: "login"
|
||||
};
|
||||
},
|
||||
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);
|
||||
}
|
||||
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
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,49 +1,49 @@
|
||||
<template>
|
||||
<view class="personal-data">
|
||||
<view class="wrapper">
|
||||
<view class="wrapList">
|
||||
<view class="item acea-row row-between-wrapper on">
|
||||
<view class="picTxt acea-row row-between-wrapper">
|
||||
<view class="pictrue" @tap="chooseImage">
|
||||
<div class="pictrue">
|
||||
<img :src="avatar" />
|
||||
</div>
|
||||
<image :src="`${$VUE_APP_RESOURCES_URL}/images/alter.png`" class="alter" />
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="name line1">{{ userInfo.nickname }}</view>
|
||||
<view class="phone">
|
||||
绑定手机号:
|
||||
<text v-if="userInfo.phone">{{ userInfo.phone }}</text>
|
||||
<text v-else>未绑定</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view>昵称</view>
|
||||
<view class="input">
|
||||
<input type="text" v-model="userInfo.nickname" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view>ID号</view>
|
||||
<view class="input acea-row row-between-wrapper">
|
||||
<input type="text" :value="userInfo.uid" disabled class="id" />
|
||||
<text class="iconfont icon-suozi"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view>手机号</view>
|
||||
<view class="input">
|
||||
<input type="text" v-if="userInfo.phone" v-model="userInfo.phone" />
|
||||
<input type="text" v-else value="未绑定" disabled class="id" />
|
||||
</view>
|
||||
</view>
|
||||
<!--
|
||||
<view class="wrapList">
|
||||
<view class="item acea-row row-between-wrapper on">
|
||||
<view class="picTxt acea-row row-between-wrapper">
|
||||
<view class="pictrue" @tap="chooseImage">
|
||||
<div class="pictrue">
|
||||
<img :src="avatar" />
|
||||
</div>
|
||||
<image :src="`${$VUE_APP_RESOURCES_URL}/images/alter.png`" class="alter" />
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="name line1">{{ userInfo.nickname }}</view>
|
||||
<view class="phone">
|
||||
绑定手机号:
|
||||
<text v-if="userInfo.phone">{{ userInfo.phone }}</text>
|
||||
<text v-else>未绑定</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view>昵称</view>
|
||||
<view class="input">
|
||||
<input type="text" v-model="userInfo.nickname" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view>ID号</view>
|
||||
<view class="input acea-row row-between-wrapper">
|
||||
<input type="text" :value="userInfo.uid" disabled class="id" />
|
||||
<text class="iconfont icon-suozi"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view>手机号</view>
|
||||
<view class="input">
|
||||
<!-- <input type="text" v-model="userInfo.phone" placeholder="未绑定"/> -->
|
||||
<input type="text" v-if="userInfo.phone" v-model="userInfo.phone" placeholder="未绑定"/>
|
||||
<input type="text" v-else value="未绑定" disabled class="id" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper" @click="goChangePassword()">
|
||||
<view>密码</view>
|
||||
<view class="input acea-row row-between-wrapper">
|
||||
@ -51,7 +51,6 @@
|
||||
<text class="iconfont icon-suozi"></text>
|
||||
</view>
|
||||
</view>
|
||||
-->
|
||||
</view>
|
||||
<view class="modifyBnt bg-color-red" @click="submit">保存修改</view>
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
@ -156,7 +155,6 @@ export default {
|
||||
},
|
||||
chooseImage() {
|
||||
chooseImage((img) => {
|
||||
console.log(img);
|
||||
this.avatar = img;
|
||||
});
|
||||
},
|
||||
|
@ -1,7 +1,11 @@
|
||||
<template>
|
||||
<view class="user">
|
||||
<view v-if="$store.getters.token || userInfo.uid">
|
||||
<view class="header bg-color-red acea-row row-between-wrapper">
|
||||
<view class="getUserBaseData header bg-color-red acea-row row-between-wrapper" v-if="!userInfo.avatar && !userInfo.nickname">
|
||||
<button class="userDataBtn" v-if="canIUseGetUserProfile" @tap="getUserInfoProfile">授权并查看用户信息</button>
|
||||
<button class="userDataBtn" v-else @getuserinfo="getUserInfo" open-type="getUserInfo">授权并查看用户信息</button>
|
||||
</view>
|
||||
<view class="header bg-color-red acea-row row-between-wrapper" v-else>
|
||||
<view class="picTxt acea-row row-between-wrapper">
|
||||
<view class="pictrue">
|
||||
<image :src="userInfo.avatar" />
|
||||
@ -19,15 +23,15 @@
|
||||
<text class="iconfont icon-bianji1"></text>
|
||||
</view>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" class="binding" v-else>
|
||||
<!-- <button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" class="binding" v-else>
|
||||
<text>绑定手机号</text>
|
||||
</button>
|
||||
</button> -->
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<button class="binding" @click="goBindPhone()" v-else>
|
||||
<!-- <button class="binding" @click="goBindPhone()" v-else>
|
||||
<text>绑定手机号</text>
|
||||
</button>
|
||||
</button> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</view>
|
||||
@ -60,7 +64,7 @@
|
||||
<text class="iconfont icon-jiantou"></text>
|
||||
</text>
|
||||
</view>
|
||||
<view class="orderState acea-row row-middle">
|
||||
<view class="orderState acea-row row-middle" v-if="userInfo.orderStatusNum !== undefined || userInfo.orderStatusNum !== null">
|
||||
<view @click="goMyOrder(0)" class="item">
|
||||
<view class="pictrue">
|
||||
<image :src="`${$VUE_APP_RESOURCES_URL}/images/dfk.png`" />
|
||||
@ -128,11 +132,11 @@
|
||||
</template>
|
||||
<script>
|
||||
import { mapState, mapGetters, mapMutations, mapActions } from 'vuex'
|
||||
import { getUserInfo, getMenuUser, bindingPhone, wxappBindingPhone } from '@/api/user'
|
||||
import { isWeixin, VUE_APP_RESOURCES_URL } from '@/utils'
|
||||
import cookie from '@/utils/store/cookie'
|
||||
import { getUserInfo, getMenuUser, wxappAuth, bindingPhone, wxappBindingPhone, wxappGetUserInfo } from '@/api/user'
|
||||
import { isWeixin, VUE_APP_RESOURCES_URL, parseQuery, getProvider } from '@/utils'
|
||||
import SwitchWindow from '@/components/SwitchWindow'
|
||||
import Authorization from '@/pages/authorization/index'
|
||||
import cookie from '@/utils/store/cookie'
|
||||
|
||||
const NAME = 'User'
|
||||
|
||||
@ -145,14 +149,23 @@ export default {
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
MyMenus: [],
|
||||
switchActive: false,
|
||||
isWeixin: false,
|
||||
canIUseGetUserProfile: false,
|
||||
MyMenus: [],
|
||||
switchActive: false,
|
||||
isWeixin: false,
|
||||
}
|
||||
},
|
||||
computed: mapGetters(['userInfo']),
|
||||
onLoad() {
|
||||
if (wx.getUserProfile) {
|
||||
this.canIUseGetUserProfile = true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['updateAuthorizationPage']),
|
||||
toLogin() {
|
||||
this.$yrouter.push('/pages/user/Login/index')
|
||||
},
|
||||
goReturnList() {
|
||||
this.$yrouter.push('/pages/order/ReturnList/index')
|
||||
},
|
||||
@ -165,9 +178,7 @@ export default {
|
||||
})
|
||||
},
|
||||
goBindPhone() {
|
||||
this.$yrouter.push({
|
||||
path: '/pages/user/BindingPhone/index',
|
||||
})
|
||||
this.$yrouter.push('/pages/user/BindingPhone/index')
|
||||
},
|
||||
goUserCoupon() {
|
||||
this.$yrouter.push('/pages/user/coupon/UserCoupon/index')
|
||||
@ -179,45 +190,41 @@ export default {
|
||||
this.$yrouter.push('/pages/user/promotion/UserPromotion/index')
|
||||
},
|
||||
goUserAccount() {
|
||||
this.$yrouter.push({
|
||||
path: '/pages/user/UserAccount/index',
|
||||
})
|
||||
this.$yrouter.push('/pages/user/UserAccount/index')
|
||||
},
|
||||
goPersonalData() {
|
||||
this.$yrouter.push('/pages/user/PersonalData/index')
|
||||
},
|
||||
getPhoneNumber: function(e) {
|
||||
let thit = this
|
||||
console.log(e)
|
||||
// 判断一下这里是不是小程序 如果是小程序,走获取微信手机号进行绑定
|
||||
if (e.mp.detail.errMsg == 'getPhoneNumber:ok') {
|
||||
uni.showLoading({
|
||||
title: '绑定中',
|
||||
})
|
||||
wxappBindingPhone({
|
||||
encryptedData: e.mp.detail.encryptedData,
|
||||
iv: e.mp.detail.iv,
|
||||
})
|
||||
.then(res => {
|
||||
// this.User();
|
||||
thit.$store.dispatch('userInfo', true)
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'success',
|
||||
duration: 2000,
|
||||
})
|
||||
})
|
||||
.catch(error => {
|
||||
uni.hideLoading()
|
||||
thit.$store.dispatch('userInfo', true)
|
||||
console.log(error)
|
||||
uni.showToast({
|
||||
title: error.msg || error.response.data.msg || error.response.data.message,
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
})
|
||||
})
|
||||
getPhoneNumber (e) {
|
||||
// 判断一下这里是不是小程序 如果是小程序,走获取微信手机号进行绑定
|
||||
if (e.mp.detail.errMsg == 'getPhoneNumber:ok') {
|
||||
uni.showLoading({
|
||||
title: '绑定中',
|
||||
})
|
||||
wxappBindingPhone({
|
||||
encryptedData: e.mp.detail.encryptedData,
|
||||
iv: e.mp.detail.iv,
|
||||
})
|
||||
.then(res => {
|
||||
// this.User();
|
||||
this.$store.dispatch('userInfo', true)
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'success',
|
||||
duration: 2000,
|
||||
})
|
||||
})
|
||||
.catch(error => {
|
||||
uni.hideLoading()
|
||||
this.$store.dispatch('userInfo', true)
|
||||
console.log(error)
|
||||
uni.showToast({
|
||||
title: error.msg || error.response.data.msg || error.response.data.message,
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
})
|
||||
})
|
||||
// // 获取当前环境的服务商
|
||||
// uni.getProvider({
|
||||
// service: "oauth",
|
||||
@ -233,7 +240,7 @@ export default {
|
||||
// })
|
||||
// .then(res => {
|
||||
// // this.User();
|
||||
// thit.$store.dispatch("userInfo", true);
|
||||
// this.$store.dispatch("userInfo", true);
|
||||
// uni.hideLoading();
|
||||
// uni.showToast({
|
||||
// title: res.msg,
|
||||
@ -243,7 +250,7 @@ export default {
|
||||
// })
|
||||
// .catch(error => {
|
||||
// uni.hideLoading();
|
||||
// thit.$store.dispatch("userInfo", true);
|
||||
// this.$store.dispatch("userInfo", true);
|
||||
// console.log(error);
|
||||
// uni.showToast({
|
||||
// title: error.msg ||
|
||||
@ -264,30 +271,81 @@ export default {
|
||||
// reject("获取环境服务商失败");
|
||||
// }
|
||||
// });
|
||||
} else {
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '已拒绝授权',
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
})
|
||||
}
|
||||
},
|
||||
// 获取用户授权,读取头像、昵称
|
||||
getUserInfo(data) {
|
||||
if (data.detail.errMsg == 'getUserInfo:fail auth deny') {
|
||||
uni.showToast({
|
||||
title: '已拒绝授权',
|
||||
title: '取消授权',
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
})
|
||||
return
|
||||
}
|
||||
},
|
||||
changeswitch: function(data) {
|
||||
// 申请获取用户信息
|
||||
getUserInfoProfile(data) {
|
||||
wx.getUserProfile({
|
||||
lang: 'zh_CN',
|
||||
desc: '需要获取您的信息用来展示',
|
||||
success: res => {
|
||||
uni.showLoading({
|
||||
title: '正在更新信息...',
|
||||
duration: 2000,
|
||||
})
|
||||
getProvider()
|
||||
.then(provider => { // 环境提供商
|
||||
if (!provider) {
|
||||
reject()
|
||||
}
|
||||
// 获取开发code
|
||||
uni.login({
|
||||
provider: provider,
|
||||
success: async loginRes => {
|
||||
wxappGetUserInfo({
|
||||
encryptedData: res.encryptedData,
|
||||
iv: res.iv,
|
||||
code: loginRes.code, // 开发code
|
||||
}).then(res => {
|
||||
if (res.status === 200) {
|
||||
this.userInfo.avatar = res.data.avatar
|
||||
this.userInfo.nickname = res.data.nickname
|
||||
} else {
|
||||
uni.showLoading({
|
||||
title: res.msg,
|
||||
duration: 2000,
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
changeswitch(data) {
|
||||
this.switchActive = data
|
||||
},
|
||||
MenuUser: function() {
|
||||
let that = this
|
||||
getMenuUser()
|
||||
// 获取用户信息
|
||||
MenuUser() {
|
||||
getMenuUser()
|
||||
.then(res => {
|
||||
uni.hideLoading()
|
||||
that.MyMenus = res.data.routine_my_menus
|
||||
this.MyMenus = res.data.routine_my_menus
|
||||
})
|
||||
.catch(error => {
|
||||
uni.hideLoading()
|
||||
console.log(error)
|
||||
})
|
||||
},
|
||||
goPages: function(index) {
|
||||
goPages(index) {
|
||||
let url = this.MyMenus[index].uniapp_url
|
||||
if (url === '/pages/user/promotion/UserPromotion/index' && this.userInfo.statu === 1) {
|
||||
if (!this.userInfo.isPromoter) {
|
||||
@ -322,7 +380,7 @@ export default {
|
||||
path: this.MyMenus[index].uniapp_url,
|
||||
})
|
||||
},
|
||||
goPages2: function() {
|
||||
goPages2() {
|
||||
this.$yrouter.push({
|
||||
path: '/pages/shop/GoodsList/index',
|
||||
query: {
|
||||
@ -357,6 +415,19 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.getUserBaseData{
|
||||
.userDataBtn{
|
||||
width: 80%;
|
||||
height: 80rpx;
|
||||
background: linear-gradient(to right, #f35447 0%, #ff8e3c 100%);
|
||||
background: -moz-linear-gradient(to right, #f35447 0%, #ff8e3c 100%);
|
||||
border-radius: 40rpx;
|
||||
font-size: 30rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 500;
|
||||
color: rgba(255, 255, 255, 1);
|
||||
}
|
||||
}
|
||||
.footer-line-height {
|
||||
height: 1 * 100rpx;
|
||||
}
|
||||
|
@ -97,18 +97,17 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
getUseCoupons: function() {
|
||||
let that = this
|
||||
if (that.loading) return //阻止下次请求(false可以进行请求);
|
||||
if (that.loadend) return //阻止结束当前请求(false可以进行请求);
|
||||
that.loading = true
|
||||
let q = { page: that.page, limit: that.limit }
|
||||
getUseCoupons() {
|
||||
if (this.loading) return //阻止下次请求(false可以进行请求);
|
||||
if (this.loadend) return //阻止结束当前请求(false可以进行请求);
|
||||
this.loading = true
|
||||
let q = { page: this.page, limit: this.limit }
|
||||
getCoupon(q).then(res => {
|
||||
that.loading = false
|
||||
this.loading = false
|
||||
//apply();js将一个数组插入另一个数组;
|
||||
that.couponsList.push.apply(that.couponsList, res.data)
|
||||
that.loadend = res.data.length < that.limit //判断所有数据是否加载完成;
|
||||
that.page = that.page + 1
|
||||
this.couponsList.push.apply(this.couponsList, res.data)
|
||||
this.loadend = res.data.length < this.limit //判断所有数据是否加载完成;
|
||||
this.page = this.page + 1
|
||||
})
|
||||
},
|
||||
},
|
||||
|
@ -7,9 +7,9 @@
|
||||
<image :src="userInfo.avatar" />
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="line1">{{ userInfo.nickname }}</view>
|
||||
<view class="line1">{{ userInfo.nickname || '' }}</view>
|
||||
<view class="integral acea-row">
|
||||
<text>积分: {{ userInfo.integral }}</text>
|
||||
<text>积分: {{ userInfo.integral || 0 }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -29,6 +29,7 @@ const vuexStore = new Vuex.Store({
|
||||
},
|
||||
mutations: {
|
||||
login(state, token, expires_time) {
|
||||
console.log('设置token')
|
||||
state.token = token
|
||||
cookie.set(loginKey, token, expires_time)
|
||||
},
|
||||
|
@ -2,7 +2,7 @@ import Vue from 'vue'
|
||||
|
||||
// import MpvueRouterPatch from 'mpvue-router-patch'
|
||||
// Vue.use(MpvueRouterPatch)
|
||||
import { wxappAuth, getUserInfo } from '@/api/user'
|
||||
import { wxappAuth, getUserInfo, wxappBindingPhone } from '@/api/user'
|
||||
import store from '@/store'
|
||||
import dayjs from 'dayjs'
|
||||
import cookie from '@/utils/store/cookie'
|
||||
@ -164,7 +164,7 @@ export const getProvider = service => {
|
||||
},
|
||||
})
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
console.log('167',error)
|
||||
})
|
||||
}
|
||||
|
||||
@ -196,7 +196,7 @@ export const login = loginInfo => {
|
||||
auth(code)
|
||||
.then(() => {
|
||||
let redirect = cookie.get('redirect').replace(/\ /g, '')
|
||||
console.log(redirect)
|
||||
console.log('199',redirect)
|
||||
if (redirect) {
|
||||
redirect = redirect.split('/pages')[1]
|
||||
if (!redirect) {
|
||||
@ -286,9 +286,8 @@ export const login = loginInfo => {
|
||||
reject('获取用户信息失败')
|
||||
})
|
||||
})
|
||||
.catch(error => {
|
||||
.catch(error => { // 登录接口调用失败
|
||||
console.log(error)
|
||||
console.log('登录接口调用失败')
|
||||
reject('登录接口调用失败')
|
||||
})
|
||||
} else {
|
||||
@ -299,18 +298,17 @@ export const login = loginInfo => {
|
||||
uni.getUserInfo({
|
||||
provider: provider,
|
||||
success: function(user) {
|
||||
console.log(user)
|
||||
console.log('获取用户信息成功')
|
||||
console.log('开始调用登录接口')
|
||||
wxappAuth({
|
||||
// phone: user.phone
|
||||
encryptedData: user.encryptedData,
|
||||
iv: user.iv,
|
||||
code: code,
|
||||
spread: cookie.get('spread'),
|
||||
})
|
||||
.then(({ data }) => {
|
||||
console.log('登录接口调用成功')
|
||||
console.log('开始处理登录信息保存,并获取用户详情')
|
||||
console.log('登录成功,开始处理登录信息保存,并获取用户详情')
|
||||
uni.hideLoading()
|
||||
store.commit('login', data.token, dayjs(data.expires_time))
|
||||
store.dispatch('userInfo', true)
|
||||
@ -356,7 +354,6 @@ export const handleGetUserInfo = () => {
|
||||
console.log('获取用户信息')
|
||||
store.dispatch('setUserInfo', res.data)
|
||||
console.log('获取用户信息后跳转回显的页面')
|
||||
|
||||
let redirect = cookie.get('redirect').replace(/\ /g, '')
|
||||
if (redirect) {
|
||||
reLaunch({
|
||||
@ -527,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 = ''
|
||||
|
@ -20,6 +20,16 @@ import cookie from '@/utils/store/cookie'
|
||||
const fly = new Fly()
|
||||
fly.config.baseURL = VUE_APP_API_URL
|
||||
|
||||
// 小程序测试请求域名
|
||||
// #ifdef MP-WEIXIN
|
||||
// fly.config.baseURL = 'http://29e25012l6.qicp.vip/api'
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
// app端
|
||||
// fly.config.baseURL = 'http://29e25012l6.qicp.vip/api'
|
||||
// #endif
|
||||
|
||||
fly.interceptors.response.use(
|
||||
response => {
|
||||
// console.log(response)
|
||||
@ -27,9 +37,10 @@ fly.interceptors.response.use(
|
||||
return response
|
||||
},
|
||||
error => {
|
||||
console.log(error)
|
||||
if (error.toString() == 'Error: Network Error') {
|
||||
console.log('————————')
|
||||
console.log('发送请求失败', error)
|
||||
console.log('请求失败', error)
|
||||
console.log('————————')
|
||||
handleLoginFailure()
|
||||
return Promise.reject({ msg: '未登录', toLogin: true })
|
||||
@ -128,9 +139,9 @@ const request = ['post', 'put', 'patch'].reduce((request, method) => {
|
||||
return baseRequest(Object.assign({ url, data, method }, defaultOpt, options))
|
||||
}
|
||||
return request
|
||||
}, {})
|
||||
}, {});
|
||||
|
||||
;['get', 'delete', 'head'].forEach(method => {
|
||||
['get', 'delete', 'head'].forEach(method => {
|
||||
/**
|
||||
*
|
||||
* @param url string 接口地址
|
||||
|
Reference in New Issue
Block a user