合并冲突
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
{
|
{
|
||||||
"launchtype" : "remote"
|
"launchtype" : "remote"
|
||||||
},
|
},
|
||||||
"h5" :
|
"mp-weixin" :
|
||||||
{
|
{
|
||||||
"launchtype" : "remote"
|
"launchtype" : "remote"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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
|
||||||
|
})
|
||||||
|
}
|
||||||
+9
-1
@@ -63,7 +63,7 @@ export function register(data) {
|
|||||||
*/
|
*/
|
||||||
export function registerReset(data) {
|
export function registerReset(data) {
|
||||||
return request.post('/register/reset', 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)
|
return request.post('wxapp/binding', data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序授权
|
||||||
|
*/
|
||||||
|
export function wxappGetUserInfo (data) {
|
||||||
|
return request.post('/wxapp/loginAuth', data)
|
||||||
|
//return request.get('/wechat/auth', data)
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* h5切换公众号登陆
|
* h5切换公众号登陆
|
||||||
* */
|
* */
|
||||||
|
|||||||
+43
-39
@@ -42,8 +42,9 @@ export default {
|
|||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data: function() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
timeInterval: null,
|
||||||
time: this.datatime,
|
time: this.datatime,
|
||||||
day: '00',
|
day: '00',
|
||||||
hour: '00',
|
hour: '00',
|
||||||
@@ -51,7 +52,7 @@ export default {
|
|||||||
second: '00',
|
second: '00',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created: function() {
|
created() {
|
||||||
this.show_time()
|
this.show_time()
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -61,10 +62,11 @@ export default {
|
|||||||
this.show_time()
|
this.show_time()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted: function() {},
|
mounted() {
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
show_time: function() {
|
show_time() {
|
||||||
let that = this
|
console.log(this.datatime)
|
||||||
if (this.time.toString().length == 13) {
|
if (this.time.toString().length == 13) {
|
||||||
// 毫秒级
|
// 毫秒级
|
||||||
console.log('毫秒')
|
console.log('毫秒')
|
||||||
@@ -77,41 +79,43 @@ export default {
|
|||||||
console.log('时间')
|
console.log('时间')
|
||||||
this.time = Date.parse(this.time) / 1000
|
this.time = Date.parse(this.time) / 1000
|
||||||
}
|
}
|
||||||
|
this.runTime()
|
||||||
function runTime() {
|
this.timeInterval = setInterval(this.runTime, 1000)
|
||||||
//时间函数
|
|
||||||
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)
|
|
||||||
},
|
},
|
||||||
|
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>
|
</script>
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ export default {
|
|||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
|
console.log(this.attr)
|
||||||
console.log(this);
|
console.log(this);
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
|
// 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://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://192.168.31.223:8008/api'
|
||||||
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
|
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
|
||||||
|
|||||||
+137
-14
@@ -69,11 +69,115 @@
|
|||||||
"UniversalLinks": "https://yixiang.co/app/"
|
"UniversalLinks": "https://yixiang.co/app/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"share": {
|
/* 应用发布信息 */
|
||||||
"weixin": {
|
"distribute" : {
|
||||||
"appid": "wx7c84ede33062d1e4",
|
/* android打包配置 */
|
||||||
"UniversalLinks": "https://yixiang.co/app/"
|
"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": {},
|
"ad": {},
|
||||||
"geolocation": {}
|
"geolocation": {}
|
||||||
@@ -179,13 +283,32 @@
|
|||||||
"router": {
|
"router": {
|
||||||
"mode": "history"
|
"mode": "history"
|
||||||
},
|
},
|
||||||
"sdkConfigs": {
|
"h5" : {
|
||||||
"maps": {
|
"title" : "yshop",
|
||||||
"qqmap": {
|
"devServer" : {
|
||||||
"key": ""
|
"disableHostCheck" : true,
|
||||||
}
|
"proxy" : {
|
||||||
}
|
"/h5api" : {
|
||||||
},
|
// 需要被代理的后台地址
|
||||||
"domain": "h5.yixiang.co"
|
"target" : "http://itxzz.51vip.biz/",
|
||||||
}
|
"changeOrigin" : true,
|
||||||
|
"secure" : false,
|
||||||
|
"pathRewrite" : {
|
||||||
|
"^/h5api" : "/api"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"router" : {
|
||||||
|
"mode" : "history"
|
||||||
|
},
|
||||||
|
"sdkConfigs" : {
|
||||||
|
"maps" : {
|
||||||
|
"qqmap" : {
|
||||||
|
"key" : ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"domain" : "h5.yixiang.co"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+16
-3
@@ -25,7 +25,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/user/RetrievePassword/index",
|
// "path": "pages/user/RetrievePassword/index",
|
||||||
|
"path": "pages/user/ChangePassword/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "重置密码"
|
"navigationBarTitleText": "重置密码"
|
||||||
}
|
}
|
||||||
@@ -296,6 +297,12 @@
|
|||||||
"navigationBarTitleText": "订单详情"
|
"navigationBarTitleText": "订单详情"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/order/OrderReturnDetail/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "售后详情"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/order/OrderSubmission/index",
|
"path": "pages/order/OrderSubmission/index",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -317,9 +324,15 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/order/ReturnList/index",
|
"path": "pages/order/ReturnList/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "退货列表"
|
"navigationBarTitleText": "我的售后"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/order/submitExpress/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "售后物流填写"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/orderAdmin/OrderIndex/index",
|
"path": "pages/orderAdmin/OrderIndex/index",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -422,7 +435,7 @@
|
|||||||
"navigationBarTitleText": "直播列表"
|
"navigationBarTitleText": "直播列表"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"easycom": {
|
"easycom": {
|
||||||
"autoscan": true,
|
"autoscan": true,
|
||||||
"custom": {
|
"custom": {
|
||||||
|
|||||||
@@ -38,8 +38,8 @@
|
|||||||
<text class="num" v-text="bargainHelpCount.remainingPrice"></text>
|
<text class="num" v-text="bargainHelpCount.remainingPrice"></text>
|
||||||
</view>
|
</view>
|
||||||
<view class="acea-row row-middle">
|
<view class="acea-row row-middle">
|
||||||
<view class="successNum" v-text="'原价' + goodsDetail.price"></view>
|
<view class="successNum" v-text="`原价:${goodsDetail.price || 0}`"></view>
|
||||||
<view class="successNum" v-text="'已有' + bargainSumCount + '人砍价成功'"></view>
|
<view class="successNum" v-text="`已有${bargainSumCount || 0}人砍价成功`"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -51,9 +51,9 @@
|
|||||||
|
|
||||||
<!-- 砍价进度条下的金额 -->
|
<!-- 砍价进度条下的金额 -->
|
||||||
<view class="balance acea-row row-between-wrapper">
|
<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-if="bargainHelpCount.price === 0">砍价成功</view>
|
||||||
<view v-else v-text="'还剩' + bargainHelpCount.price + '元'"></view>
|
<view v-else v-text="`还剩${bargainHelpCount.price || 0}元`"></view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 砍价成功:-->
|
<!-- 砍价成功:-->
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="group-box">
|
<view class="group-box">
|
||||||
<view class="goods-item" v-for="(groupon, index) in grouponList" :key="groupon.id">
|
<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">
|
<block slot="tag">
|
||||||
<view class="tag" v-if="index < 3">TOP{{ index + 1 }}</view>
|
<view class="tag" v-if="index < 3">TOP{{ index + 1 }}</view>
|
||||||
</block>
|
</block>
|
||||||
@@ -22,7 +23,9 @@
|
|||||||
<text class="group-num">{{ groupon.people || 0 }}人团</text>
|
<text class="group-num">{{ groupon.people || 0 }}人团</text>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</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>
|
</activity-card>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<view class="tui-bg__box">
|
<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>
|
<image :src="`${$VUE_APP_RESOURCES_URL}/images/bg_seckill.png`" class="tui-bg__img" mode="widthFix" :style="{ opacity: opacity }"></image>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="tui-header__bg">
|
<view class="tui-header__bg">
|
||||||
<image :src="`${$VUE_APP_RESOURCES_URL}/images/bg_seckill.png`" class="tui-bg__img" mode="widthFix"></image>
|
<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>
|
<scroll-view class="tui-time-slot" scroll-x>
|
||||||
@@ -37,7 +38,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="tui-countdown__box" v-if="item.status == 1 || item.status == 2">
|
<view class="tui-countdown__box" v-if="item.status == 1 || item.status == 2">
|
||||||
<text>距离{{ item.status == 1 ? '结束还剩' : '开始还有' }}</text>
|
<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>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
@@ -163,6 +164,7 @@ export default {
|
|||||||
that.status = false
|
that.status = false
|
||||||
that.active = index
|
that.active = index
|
||||||
that.datatime = that.timeList[that.active].stop
|
that.datatime = that.timeList[that.active].stop
|
||||||
|
console.log(new Date(that.datatime))
|
||||||
this.seckillList = []
|
this.seckillList = []
|
||||||
that.getSeckillList()
|
that.getSeckillList()
|
||||||
},
|
},
|
||||||
@@ -212,6 +214,9 @@ export default {
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
/* #ifdef H5 */
|
||||||
|
top: 80rpx;
|
||||||
|
/* #endif */
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,6 +226,9 @@ export default {
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
/* #ifdef H5 */
|
||||||
|
top: 80rpx;
|
||||||
|
/* #endif */
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
formatPrice(price, index) {
|
formatPrice(price, index) {
|
||||||
console.log(price)
|
// console.log(price)
|
||||||
if (price) {
|
if (price) {
|
||||||
return price.split('.')[index]
|
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() {
|
setCollect: function() {
|
||||||
let that = this,
|
let that = this,
|
||||||
@@ -452,24 +443,41 @@ export default {
|
|||||||
this.$set(this, 'attrTxt', '请选择')
|
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() {
|
openTeam: function() {
|
||||||
var that = this
|
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
|
that.attr.cartAttr = !this.attr.cartAttr
|
||||||
} else {
|
// 设置拼团价格
|
||||||
|
that.attr.productSelect.price = this.storeInfo.price
|
||||||
|
} else { // 已有弹框——初始化商品信息,下单请求
|
||||||
var data = {}
|
var data = {}
|
||||||
data.productId = that.storeInfo.productId
|
data.productId = that.storeInfo.productId
|
||||||
|
data.price = that.storeInfo.price
|
||||||
data.cartNum = that.attr.productSelect.cart_num
|
data.cartNum = that.attr.productSelect.cart_num
|
||||||
data.uniqueId = that.attr.productSelect.unique
|
data.uniqueId = that.attr.productSelect.unique
|
||||||
data.combinationId = that.storeInfo.id
|
data.combinationId = that.storeInfo.id
|
||||||
data.new = 1
|
data.new = 1
|
||||||
|
console.log(data)
|
||||||
postCartAdd(data)
|
postCartAdd(data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
that.$yrouter.push({
|
that.$yrouter.push({
|
||||||
path: '/pages/order/OrderSubmission/index',
|
path: '/pages/order/OrderSubmission/index',
|
||||||
query: {
|
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-price__box">
|
||||||
<view class="tui-goods-price">
|
<view class="tui-goods-price">
|
||||||
<view class="tui-size-24">¥</view>
|
<view class="tui-size-24">¥</view>
|
||||||
<view class="tui-price-large">{{ storeCombination.price.split('.')[0] }}</view>
|
<view class="tui-price-large">{{ storeCombination.price.split('.')[0] || 0 }}</view>
|
||||||
<view class="tui-size-24">.{{ storeCombination.price.split('.')[1] }}</view>
|
<view class="tui-size-24">.{{ storeCombination.price.split('.')[1] || 0 }}</view>
|
||||||
<!-- <text>已拼2020件</text> -->
|
<!-- <text>已拼2020件</text> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="tui-price-tag">{{ storeCombination.people }}人团</view>
|
<view class="tui-price-tag">{{ storeCombination.people || 0 }}人团</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -96,15 +96,14 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted: function() {
|
mounted() {
|
||||||
var that = this
|
|
||||||
let url = handleQrCode()
|
let url = handleQrCode()
|
||||||
if (url) {
|
if (url) {
|
||||||
that.pinkId = url.pinkId
|
this.pinkId = url.pinkId
|
||||||
} else {
|
} else {
|
||||||
that.pinkId = that.$yroute.query.id
|
this.pinkId = this.$yroute.query.id
|
||||||
}
|
}
|
||||||
that.getCombinationPink()
|
this.getCombinationPink()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
pay: function() {
|
pay: function() {
|
||||||
|
|||||||
@@ -1,10 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="poster-poster" v-if="status === false">
|
<view class="poster-poster" v-if="status === false">
|
||||||
<view class="tip">
|
<view class="tip">
|
||||||
<text class="iconfont icon-shuoming"></text>提示:长按图片保存至手机相册
|
<!-- #ifndef H5 -->
|
||||||
|
<text class="iconfont icon-shuoming"></text>提示:长按图片保存至手机相册
|
||||||
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
<view class="poster">
|
<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>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -18,73 +25,95 @@
|
|||||||
name: "Poster",
|
name: "Poster",
|
||||||
components: {},
|
components: {},
|
||||||
props: {},
|
props: {},
|
||||||
data: function () {
|
data () {
|
||||||
return {
|
return {
|
||||||
status: true,
|
status: true,
|
||||||
id: 0,
|
id: 0,
|
||||||
image: ""
|
image: ""
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted () {
|
||||||
var that = this;
|
var id = this.$yroute.query.id;
|
||||||
var id = that.$yroute.query.id;
|
var type = this.$yroute.query.type;
|
||||||
var type = that.$yroute.query.type;
|
this.id = id;
|
||||||
that.id = id;
|
|
||||||
if (type == 2) {
|
if (type == 2) {
|
||||||
that.getBargainPoster();
|
this.getBargainPoster();
|
||||||
} else {
|
} else {
|
||||||
that.getCombinationPoster();
|
this.getCombinationPoster();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 砍价海报
|
// 砍价海报
|
||||||
getBargainPoster: function () {
|
getBargainPoster: function () {
|
||||||
var that = this;
|
var that = this;
|
||||||
let from = this.$deviceType
|
let from = this.$deviceType
|
||||||
if (from == 'weixin' || this.$deviceType == 'weixinh5') {
|
if (from == 'weixin' || this.$deviceType == 'weixinh5') {
|
||||||
from = 'uniappH5'
|
from = 'uniappH5'
|
||||||
}
|
}
|
||||||
getBargainPoster({
|
getBargainPoster({
|
||||||
bargainId: that.id,
|
bargainId: that.id,
|
||||||
from
|
from
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
that.image = res.data.url;
|
that.image = res.data.url;
|
||||||
that.status = false;
|
that.status = false;
|
||||||
})
|
})
|
||||||
.catch(res => {
|
.catch(res => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 拼团海报
|
// 拼团海报
|
||||||
getCombinationPoster: function () {
|
getCombinationPoster: function () {
|
||||||
var that = this;
|
var that = this;
|
||||||
console.log(this.$deviceType)
|
console.log(this.$deviceType)
|
||||||
let from = this.$deviceType
|
let from = this.$deviceType
|
||||||
if (from == 'weixin' || this.$deviceType == 'weixinh5') {
|
if (from == 'weixin' || this.$deviceType == 'weixinh5') {
|
||||||
from = 'uniappH5'
|
from = 'uniappH5'
|
||||||
}
|
}
|
||||||
console.log(from)
|
console.log(from)
|
||||||
getCombinationPoster({
|
getCombinationPoster({
|
||||||
id: that.id,
|
id: that.id,
|
||||||
from
|
from
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
that.image = res.data.url;
|
that.image = res.data.url;
|
||||||
that.status = false;
|
that.status = false;
|
||||||
})
|
})
|
||||||
.catch(res => {
|
.catch(res => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
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>
|
</script>
|
||||||
|
|||||||
@@ -6,10 +6,14 @@
|
|||||||
<view class="force-login__content y-f">
|
<view class="force-login__content y-f">
|
||||||
<open-data class="user-avatar" type="userAvatarUrl"></open-data>
|
<open-data class="user-avatar" type="userAvatarUrl"></open-data>
|
||||||
<open-data class="user-name" type="userNickName"></open-data>
|
<open-data class="user-name" type="userNickName"></open-data>
|
||||||
<view class="login-notice">为了提供更优质的服务,需要获取您的头像昵称</view>
|
<view class="login-notice">为了提供更优质的服务,请先登录</view>
|
||||||
<button class="cu-btn author-btn" v-if="canIUseGetUserProfile" @tap="getUserInfoProfile">授权并查看</button>
|
<button
|
||||||
<button class="cu-btn author-btn" v-else @getuserinfo="getUserInfo" open-type="getUserInfo">授权并查看</button>
|
class="cu-btn author-btn"
|
||||||
<button class="cu-btn close-btn" @tap="back">暂不授权</button>
|
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>
|
||||||
</view>
|
</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
@@ -27,27 +31,28 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapState, mapMutations, mapActions } from 'vuex'
|
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 dayjs from 'dayjs'
|
||||||
import cookie from '@/utils/store/cookie'
|
import cookie from '@/utils/store/cookie'
|
||||||
import { login, authorize } from '@/utils'
|
import store from '@/store'
|
||||||
|
|
||||||
|
// 公众号登录
|
||||||
|
import { auth } from '@/libs/wechat.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
authorize: false,
|
authorize: false,
|
||||||
canIUseGetUserProfile: false,
|
canIUseGetUserProfile: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['isAuthorization', '$deviceType', 'token']),
|
...mapState(['isAuthorization', '$deviceType', 'token']),
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
console.log(wx.getUserProfile)
|
|
||||||
if (wx.getUserProfile) {
|
if (wx.getUserProfile) {
|
||||||
console.log(this)
|
|
||||||
this.canIUseGetUserProfile = true
|
this.canIUseGetUserProfile = true
|
||||||
console.log(this.canIUseGetUserProfile)
|
|
||||||
}
|
}
|
||||||
// // 先校验用户是否授权,如果没有授权,显示授权按钮
|
// // 先校验用户是否授权,如果没有授权,显示授权按钮
|
||||||
},
|
},
|
||||||
@@ -74,9 +79,9 @@ export default {
|
|||||||
query: {},
|
query: {},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getUserInfo(data) {
|
getUserInfoBtn(data) {
|
||||||
console.log(data)
|
console.log(data)
|
||||||
console.log('getUserInfo')
|
console.log('getUserInfoBtn')
|
||||||
if (data.detail.errMsg == 'getUserInfo:fail auth deny') {
|
if (data.detail.errMsg == 'getUserInfo:fail auth deny') {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '取消授权',
|
title: '取消授权',
|
||||||
@@ -106,13 +111,14 @@ export default {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 申请获取用户信息
|
||||||
getUserInfoProfile(data) {
|
getUserInfoProfile(data) {
|
||||||
console.log('getUserInfoProfile')
|
console.log('getUserInfoProfile')
|
||||||
wx.getUserProfile({
|
wx.getUserProfile({
|
||||||
lang: 'zh_CN',
|
lang: 'zh_CN',
|
||||||
desc: '需要获取您的信息用来展示',
|
desc: '需要获取您的信息用来展示',
|
||||||
success: res => {
|
success: res => {
|
||||||
console.log(res)
|
console.log('用户信息',res)
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '登录中',
|
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() {
|
mounted() {
|
||||||
if (wx.getUserProfile) {
|
if (wx.getUserProfile) {
|
||||||
console.log(this)
|
|
||||||
this.canIUseGetUserProfile = true
|
this.canIUseGetUserProfile = true
|
||||||
console.log(this.canIUseGetUserProfile)
|
console.log(this.canIUseGetUserProfile)
|
||||||
}
|
}
|
||||||
|
|||||||
+94
-66
@@ -19,33 +19,53 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
<Banner v-if="item.type == 'banner'" :detail="item.componentContent.bannerData" @getbgcolor="getbgcolor"></Banner>
|
<Banner v-if="item.type == '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>
|
:detail="item.componentContent.bannerData"
|
||||||
<view class="content_box home_content_box" v-if="item.type == 'menu' && item.componentContent.menus">
|
@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>
|
<Menu :list="item.componentContent.menus"></Menu>
|
||||||
</view>
|
</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" />
|
<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 -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<Live v-if="item.type == 'live'" :detail="live"></Live>
|
<Live v-if="item.type == 'live'" :detail="live" />
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- 为您推荐 -->
|
<!-- 为您推荐 -->
|
||||||
<PromotionGood v-if="item.type == 'promotionGood'" :benefit="benefit"></PromotionGood>
|
<PromotionGood v-if="item.type == 'promotionGood'" :benefit="benefit" />
|
||||||
<Coupon-window :coupon-list="couponList" v-if="showCoupon" @checked="couponClose" @close="couponClose"> </Coupon-window>
|
<Coupon-window
|
||||||
|
:coupon-list="couponList"
|
||||||
|
v-if="showCoupon"
|
||||||
|
@checked="couponClose" @close="couponClose" />
|
||||||
</view>
|
</view>
|
||||||
|
<!-- #ifdef H5 -->
|
||||||
|
<view class="bottomSpace" style='line-height:100rpx'>正在使用H5方式浏览</view>
|
||||||
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -178,6 +198,7 @@ export default {
|
|||||||
observeParents: true,
|
observeParents: true,
|
||||||
},
|
},
|
||||||
bgImage: '',
|
bgImage: '',
|
||||||
|
// indexTitle: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -194,34 +215,40 @@ export default {
|
|||||||
return style
|
return style
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onLoad: function() {
|
onLoad() {
|
||||||
this.getLocation()
|
this.getLocation()
|
||||||
let that = this
|
|
||||||
// uni.showLoading({
|
// uni.showLoading({
|
||||||
// title: "加载中",
|
// title: "加载中",
|
||||||
// });
|
// });
|
||||||
getCanvas()
|
getCanvas()
|
||||||
.then(res => {})
|
.then(res => {
|
||||||
|
console.log('223',res)
|
||||||
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
if (!error) {
|
||||||
|
return
|
||||||
|
}
|
||||||
this.homeData = JSON.parse(error.data.json)
|
this.homeData = JSON.parse(error.data.json)
|
||||||
console.log(this.homeData)
|
console.log('225',this.homeData)
|
||||||
console.log(222)
|
|
||||||
})
|
})
|
||||||
getHomeData().then(res => {
|
getHomeData().then(res => {
|
||||||
that.logoUrl = res.data.logoUrl
|
this.logoUrl = res.data.logoUrl
|
||||||
res.data.banner.map(item => (item.bgcolor = item.color || ''))
|
res.data.banner.forEach(item => (item.bgcolor = item.color || ''))
|
||||||
that.$set(that, 'info', res.data.info)
|
this.info = res.data.info
|
||||||
that.$set(that, 'firstList', res.data.firstList)
|
console.log('239', res.data.info)
|
||||||
that.$set(that, 'bastList', res.data.bastList)
|
console.log('239',this.info)
|
||||||
that.$set(that, 'likeInfo', res.data.likeInfo)
|
this.$set(this, 'info', res.data.info)
|
||||||
that.$set(that, 'live', res.data.liveList)
|
this.$set(this, 'firstList', res.data.firstList)
|
||||||
that.$set(that, 'lovely', res.data.lovely)
|
this.$set(this, 'bastList', res.data.bastList)
|
||||||
that.$set(that, 'benefit', res.data.benefit)
|
this.$set(this, 'likeInfo', res.data.likeInfo)
|
||||||
that.$set(that, 'couponList', res.data.couponList)
|
this.$set(this, 'live', res.data.liveList)
|
||||||
that.$set(that, 'combinationList', res.data.combinationList)
|
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()
|
uni.hideLoading()
|
||||||
that.setOpenShare()
|
this.setOpenShare()
|
||||||
// that.doColorThief()
|
// this.doColorThief()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -288,43 +315,44 @@ export default {
|
|||||||
startQr: function() {
|
startQr: function() {
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
success: res => {
|
success: res => {
|
||||||
let option = handleUrlParam(res.result)
|
let option = handleUrlParam(res.result)
|
||||||
switch (option.pageType) {
|
console.log(option)
|
||||||
case 'good':
|
switch (option.pageType) {
|
||||||
// 跳转商品详情
|
case 'good':
|
||||||
this.$yrouter.push({
|
// 跳转商品详情
|
||||||
path: '/pages/shop/GoodsCon/index',
|
this.$yrouter.push({
|
||||||
query: {
|
path: '/pages/shop/GoodsCon/index',
|
||||||
q: res.result,
|
query: {
|
||||||
},
|
q: res.result,
|
||||||
})
|
},
|
||||||
break
|
})
|
||||||
case 'group':
|
break
|
||||||
// 跳转团购
|
case 'group':
|
||||||
this.$yrouter.push({
|
// 跳转团购
|
||||||
path: '/pages/activity/GroupRule/index',
|
this.$yrouter.push({
|
||||||
query: {
|
path: '/pages/activity/GroupRule/index',
|
||||||
q: res.result,
|
query: {
|
||||||
},
|
q: res.result,
|
||||||
})
|
},
|
||||||
break
|
})
|
||||||
case 'dargain':
|
break
|
||||||
// 跳转砍价
|
case 'dargain':
|
||||||
this.$yrouter.push({
|
// 跳转砍价
|
||||||
path: '/pages/activity/DargainDetails/index',
|
this.$yrouter.push({
|
||||||
query: {
|
path: '/pages/activity/DargainDetails/index',
|
||||||
q: res.result,
|
query: {
|
||||||
},
|
q: res.result,
|
||||||
})
|
},
|
||||||
break
|
})
|
||||||
default:
|
break
|
||||||
// 跳转分销
|
default:
|
||||||
this.$yrouter.push({
|
// 跳转分销
|
||||||
path: '/pages/Loading/index',
|
this.$yrouter.push({
|
||||||
query: {},
|
path: '/pages/Loading/index',
|
||||||
})
|
query: {},
|
||||||
break
|
})
|
||||||
}
|
break
|
||||||
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
+367
-126
@@ -1,153 +1,394 @@
|
|||||||
|
<!-- 售后提交 -->
|
||||||
<template>
|
<template>
|
||||||
<view class="apply-return">
|
<view class="apply-return">
|
||||||
<view class="goodsStyle acea-row row-between" v-for="cart in orderInfo.cartInfo" :key="cart.id">
|
<!-- 申请售后 -->
|
||||||
<view class="pictrue">
|
<view class="container" v-if="selected">
|
||||||
<image :src="cart.productInfo.image" class="image" />
|
<view class="goodsStyle acea-row row-between"
|
||||||
</view>
|
v-for="cart in selectProduct"
|
||||||
<view class="text acea-row row-between">
|
:key="cart.id"
|
||||||
<view class="name line2">{{ cart.productInfo.storeName }}</view>
|
>
|
||||||
<view class="money">
|
<view class="pictrue">
|
||||||
<view>
|
<image :src="cart.productInfo.image" class="image" />
|
||||||
¥{{
|
</view>
|
||||||
cart.productInfo.attrInfo
|
<view class="text acea-row row-between">
|
||||||
? cart.productInfo.attrInfo.price
|
<view class="name line2">{{ cart.productInfo.storeName }}</view>
|
||||||
: cart.productInfo.price
|
<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 class="num">x{{ cart.cartNum }}</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view class="list">
|
||||||
<view class="list">
|
<view v-if="serviceType === 1" class="item acea-row row-between-wrapper">
|
||||||
<view class="item acea-row row-between-wrapper">
|
<view>退货件数</view>
|
||||||
<view>退货件数</view>
|
<view class="num">{{ totalNum || 0 }}</view>
|
||||||
<view class="num">{{ orderInfo.totalNum }}</view>
|
</view>
|
||||||
</view>
|
|
||||||
<view class="item acea-row row-between-wrapper">
|
|
||||||
<view>退款金额</view>
|
|
||||||
<view class="num">¥{{ orderInfo.payPrice }}</view>
|
|
||||||
</view>
|
|
||||||
<picker :value="reason" :range="reasonList" @change="changeReason">
|
|
||||||
<view class="item acea-row row-between-wrapper">
|
<view class="item acea-row row-between-wrapper">
|
||||||
<view>退款原因</view>
|
<view>退款金额</view>
|
||||||
<view class="num">{{reason}}</view>
|
<view class="num">¥{{ totalMoney || 0 }}</view>
|
||||||
<text class="iconfont icon-jiantou"></text>
|
</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>
|
</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>
|
</view>
|
||||||
<view class="returnBnt bg-color-red" @click="submit">申请退款</view>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
orderDetail,
|
orderDetail,
|
||||||
getRefundReason,
|
getRefundReason,
|
||||||
postOrderRefund
|
postOrderRefund
|
||||||
} from "@/api/order";
|
} from "@/api/order";
|
||||||
import {
|
import {
|
||||||
trim
|
submitAfterSealsOrder
|
||||||
} from "@/utils";
|
} from '@/api/aftersales.js';
|
||||||
import {
|
import {
|
||||||
VUE_APP_API_URL
|
trim
|
||||||
} from "@/config";
|
} from "@/utils";
|
||||||
|
import {
|
||||||
|
VUE_APP_API_URL
|
||||||
|
} from "@/config";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "goodsReturn",
|
name: "goodsReturn",
|
||||||
components: {
|
components: {
|
||||||
// VueCoreImageUpload
|
// VueCoreImageUpload
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
url: `${VUE_APP_API_URL}/upload/image`,
|
url: `${VUE_APP_API_URL}/upload/image`,
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: "Bearer " + this.$store.state.token
|
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];
|
|
||||||
},
|
},
|
||||||
imageuploaded(res) {
|
id: 0,
|
||||||
if (res.status !== 200) {
|
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({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
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() {
|
getRefundReason() {
|
||||||
const refund_reason_wap_explain = trim(this.refund_reason_wap_explain),
|
getRefundReason().then(res => {
|
||||||
text = this.reason;
|
this.reasonList = res.data;
|
||||||
if (!text) {
|
});
|
||||||
|
},
|
||||||
|
// 选择退款商品
|
||||||
|
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({
|
uni.showToast({
|
||||||
title: "请选择退款原因",
|
title: res.msg,
|
||||||
icon: 'none',
|
icon: "success",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
return
|
setTimeout(() => {
|
||||||
|
this.$yrouter.push({ path: '/pages/order/ReturnList/index' });
|
||||||
|
}, 1500)
|
||||||
}
|
}
|
||||||
postOrderRefund({
|
})
|
||||||
text,
|
.catch(err => {
|
||||||
uni: this.orderInfo.orderId,
|
uni.showToast({
|
||||||
refund_reason_wap_img: this.refund_reason_wap_img.join(","),
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
refund_reason_wap_explain
|
icon: 'none',
|
||||||
})
|
duration: 2000
|
||||||
.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();
|
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
};
|
||||||
</script>
|
</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>
|
||||||
|
|||||||
@@ -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="header bg-color-red acea-row row-middle" :class="refundOrder ? 'on' : ''">
|
||||||
<view class="data" :class="refundOrder ? 'on' : ''">
|
<view class="data" :class="refundOrder ? 'on' : ''">
|
||||||
<view class="state">{{ orderInfo._status._msg }}</view>
|
<view class="state">{{ orderInfo._status._msg }}</view>
|
||||||
<view>{{ orderInfo.createTime }}</view>
|
<view>{{ orderInfo.createTime || '' }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<template v-if="!refundOrder">
|
<template v-if="!refundOrder">
|
||||||
@@ -24,14 +24,18 @@
|
|||||||
: 'icon-yuandianxiao',
|
: 'icon-yuandianxiao',
|
||||||
status.type >= 0 ? 'font-color-red' : ''
|
status.type >= 0 ? 'font-color-red' : ''
|
||||||
]"></view>
|
]"></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="[
|
<view class="iconfont" :class="[
|
||||||
status.type === 1 ? 'icon-webicon318' : 'icon-yuandianxiao',
|
status.type === 1 ? 'icon-webicon318' : 'icon-yuandianxiao',
|
||||||
status.type >= 1 && status.type != 6 && status.type != 9
|
status.type >= 1 && status.type != 6 && status.type != 9
|
||||||
? 'font-color-red'
|
? 'font-color-red'
|
||||||
: ''
|
: ''
|
||||||
]"></view>
|
]"></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>
|
v-if="orderInfo.shippingType === 1"></view>
|
||||||
<view class="iconfont"
|
<view class="iconfont"
|
||||||
:class="[status.type === 2 ? 'icon-webicon318' : 'icon-yuandianxiao',status.type >= 2 && status.type != 6 && status.type != 9? 'font-color-red': '']"
|
: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>
|
||||||
<view class="line" :class="{
|
<view class="line" :class="{
|
||||||
'bg-color-red':
|
'bg-color-red': status.type > 3 && status.type != 6 && status.type != 9
|
||||||
status.type > 3 && status.type != 6 && status.type != 9
|
|
||||||
}"></view>
|
}"></view>
|
||||||
<view class="iconfont" :class="[
|
<view class="iconfont" :class="[
|
||||||
status.type == 4 ? 'icon-webicon318' : 'icon-yuandianxiao',
|
status.type == 4 ? 'icon-webicon318' : 'icon-yuandianxiao',
|
||||||
@@ -97,7 +100,10 @@
|
|||||||
<view class="name">
|
<view class="name">
|
||||||
{{ orderInfo.realName }}
|
{{ orderInfo.realName }}
|
||||||
<text class="phone">{{ orderInfo.userPhone }}</text>
|
<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>
|
||||||
<view>{{ orderInfo.userAddress }}</view>
|
<view>{{ orderInfo.userAddress }}</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -105,8 +111,9 @@
|
|||||||
<div class="name">
|
<div class="name">
|
||||||
{{ system_store.name}}
|
{{ system_store.name}}
|
||||||
<span class="phone">{{ system_store.phone }}</span>
|
<span class="phone">{{ system_store.phone }}</span>
|
||||||
<span @click="telPhone(system_store.phone)" class="iconfont icon-tonghua font-color-red"
|
<span @click="telPhone(system_store.phone)"
|
||||||
:href="'tel:' + system_store.phone"></span>
|
class="iconfont icon-tonghua font-color-red"
|
||||||
|
:href="'tel:' + system_store.phone"></span>
|
||||||
</div>
|
</div>
|
||||||
<div>{{ system_store.address }}</div>
|
<div>{{ system_store.address }}</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -114,24 +121,28 @@
|
|||||||
<image :src="`${$VUE_APP_RESOURCES_URL}/images/line.jpg`" />
|
<image :src="`${$VUE_APP_RESOURCES_URL}/images/line.jpg`" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</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="wrapper">
|
||||||
<view class="item acea-row row-between">
|
<view class="item acea-row row-between">
|
||||||
<view>订单编号:</view>
|
<view>订单编号:</view>
|
||||||
<view class="conter acea-row row-middle row-right">
|
<view class="conter acea-row row-middle row-right">
|
||||||
{{ orderInfo.orderId }}
|
{{ orderInfo.orderId || '' }}
|
||||||
<!-- #ifndef H5 -->
|
<!-- #ifndef H5 -->
|
||||||
<text class="copy copy-data" @click="copyClipboard(orderInfo.orderId)">复制</text>
|
<text class="copy copy-data" @click="copyClipboard(orderInfo.orderId)">复制</text>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between">
|
<view class="item acea-row row-between">
|
||||||
<view>下单时间:</view>
|
<view>下单时间:</view>
|
||||||
<view class="conter">{{ orderInfo.createTime }}</view>
|
<view class="conter">{{ orderInfo.createTime || '' }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between">
|
<view class="item acea-row row-between">
|
||||||
<view>订单类型:</view>
|
<view>订单类型:</view>
|
||||||
<view class="conter">{{ orderTypeName }}</view>
|
<view class="conter">{{ orderTypeName || '' }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between">
|
<view class="item acea-row row-between">
|
||||||
<view>支付状态:</view>
|
<view>支付状态:</view>
|
||||||
@@ -139,11 +150,11 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between">
|
<view class="item acea-row row-between">
|
||||||
<view>支付方式:</view>
|
<view>支付方式:</view>
|
||||||
<view class="conter">{{ orderInfo._status._payType }}</view>
|
<view class="conter">{{ orderInfo._status._payType || '' }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between" v-if="orderInfo.mark">
|
<view class="item acea-row row-between" v-if="orderInfo.mark">
|
||||||
<view>买家留言:</view>
|
<view>买家留言:</view>
|
||||||
<view class="conter">{{ orderInfo.mark }}</view>
|
<view class="conter">{{ orderInfo.mark || '' }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -185,42 +196,42 @@
|
|||||||
<view class="wrapper" v-if="refundOrder">
|
<view class="wrapper" v-if="refundOrder">
|
||||||
<view class="item acea-row row-between">
|
<view class="item acea-row row-between">
|
||||||
<view>收货人:</view>
|
<view>收货人:</view>
|
||||||
<view class="conter">{{ orderInfo.realName }}</view>
|
<view class="conter">{{ orderInfo.realName || '' }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between">
|
<view class="item acea-row row-between">
|
||||||
<view>联系电话:</view>
|
<view>联系电话:</view>
|
||||||
<view class="conter">{{ orderInfo.userPhone }}</view>
|
<view class="conter">{{ orderInfo.userPhone || '' }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between">
|
<view class="item acea-row row-between">
|
||||||
<view>收货地址:</view>
|
<view>收货地址:</view>
|
||||||
<view class="conter">{{ orderInfo.userAddress }}</view>
|
<view class="conter">{{ orderInfo.userAddress || '' }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="wrapper">
|
<view class="wrapper">
|
||||||
<view class="item acea-row row-between" v-if="!isIntegral">
|
<view class="item acea-row row-between" v-if="!isIntegral">
|
||||||
<view>支付金额:</view>
|
<view>支付金额:</view>
|
||||||
<view class="conter">¥{{ orderInfo.totalPrice }}</view>
|
<view class="conter">¥{{ orderInfo.totalPrice || 0 }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between" v-if="isIntegral">
|
<view class="item acea-row row-between" v-if="isIntegral">
|
||||||
<view>支付积分:</view>
|
<view>支付积分:</view>
|
||||||
<view class="conter">{{ orderInfo.payIntegral }}积分</view>
|
<view class="conter">{{ orderInfo.payIntegral || 0 }}积分</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between" v-if="orderInfo.couponPrice > 0">
|
<view class="item acea-row row-between" v-if="orderInfo.couponPrice > 0">
|
||||||
<view>优惠券抵扣:</view>
|
<view>优惠券抵扣:</view>
|
||||||
<view class="conter">-¥{{ orderInfo.couponPrice }}</view>
|
<view class="conter">-¥{{ orderInfo.couponPrice ||0 }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between" v-if="orderInfo.useIntegral > 0">
|
<view class="item acea-row row-between" v-if="orderInfo.useIntegral > 0">
|
||||||
<view>积分抵扣:</view>
|
<view>积分抵扣:</view>
|
||||||
<view class="conter">-¥{{ orderInfo.deductionPrice }}</view>
|
<view class="conter">-¥{{ orderInfo.deductionPrice || 0 }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between" v-if="orderInfo.payPostage > 0">
|
<view class="item acea-row row-between" v-if="orderInfo.payPostage > 0">
|
||||||
<view>运费:</view>
|
<view>运费:</view>
|
||||||
<view class="conter">¥{{ orderInfo.payPostage }}</view>
|
<view class="conter">¥{{ orderInfo.payPostage || 0 }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="actualPay acea-row row-right">
|
<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.payPrice || 0 }}</text>
|
||||||
<text class="money font-color-red" v-if="isIntegral">{{ orderInfo.payIntegral }}积分</text>
|
<text class="money font-color-red" v-if="isIntegral">{{ orderInfo.payIntegral || 0 }}积分</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="height:100rpx;" v-if="!refundOrder && offlineStatus"></view>
|
<view style="height:100rpx;" v-if="!refundOrder && offlineStatus"></view>
|
||||||
@@ -229,13 +240,19 @@
|
|||||||
<view class="bnt cancel" @click="cancelOrder">取消订单</view>
|
<view class="bnt cancel" @click="cancelOrder">取消订单</view>
|
||||||
<view class="bnt bg-color-red" @click="pay = true">立即付款</view>
|
<view class="bnt bg-color-red" @click="pay = true">立即付款</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="status.type == 1">
|
<template v-if="orderInfo.refundStatus === 0 && orderInfo.paid === 1">
|
||||||
<view class="bnt cancel" @click="goGoodsReturn(orderInfo)">申请退款</view>
|
<view class="bnt cancel" @click="goGoodsReturn(orderInfo)">申请售后</view>
|
||||||
</template>
|
</template>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<template v-if="orderInfo.shippingType == 1 && status.type == 2">
|
<template v-if="orderInfo.shippingType == 1 && status.type == 2">
|
||||||
<view class="bnt default"
|
<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>
|
<view class="bnt bg-color-red" @click="takeOrder">确认收货</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="orderInfo.shippingType == 1 && status.type == 3 && orderInfo.deliveryType == 'express'">
|
<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>
|
<view class="bnt bg-color-red" @click="goGroupRule(orderInfo)">查看拼团</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</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">
|
<view class="geoPage" v-if="mapShow">
|
||||||
<iframe width="100%" height="100%" frameborder="0" scrolling="no"
|
<iframe
|
||||||
:src="'https://apis.map.qq.com/uri/v1/geocoder?coord=' + system_store.latitude + ',' +system_store.longitude +'&referer=' +mapKey"></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>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -325,6 +352,7 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
copyClipboard,
|
copyClipboard,
|
||||||
|
// 申请退款
|
||||||
goGoodsReturn(orderInfo) {
|
goGoodsReturn(orderInfo) {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/order/GoodsReturn/index",
|
path: "/pages/order/GoodsReturn/index",
|
||||||
@@ -494,7 +522,6 @@
|
|||||||
},
|
},
|
||||||
async toPay(type) {
|
async toPay(type) {
|
||||||
var that = this;
|
var that = this;
|
||||||
console.log(type, "支付方式");
|
|
||||||
await payOrderHandle(this.orderInfo.orderId, type, that.from);
|
await payOrderHandle(this.orderInfo.orderId, type, that.from);
|
||||||
that.getDetail();
|
that.getDetail();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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>
|
||||||
<view class="iconfont icon-jiantou"></view>
|
<view class="iconfont icon-jiantou"></view>
|
||||||
</view>
|
</view>
|
||||||
<div class="address acea-row row-between-wrapper" v-if="shipping_type === 1" @click="showStoreList">
|
<view class="address acea-row row-between-wrapper" v-if="shipping_type === 1" @click="showStoreList">
|
||||||
<div class="addressCon" v-if="storeItems">
|
<view class="addressCon" v-if="storeItems">
|
||||||
<div class="name">
|
<view class="name">
|
||||||
{{ storeItems.name }}
|
{{ storeItems.name }}
|
||||||
<span class="phone">{{ storeItems.phone }}</span>
|
<span class="phone">{{ storeItems.phone }}</span>
|
||||||
</div>
|
</view>
|
||||||
<div>{{ storeItems.address }}</div>
|
<view>{{ storeItems.address }}</view>
|
||||||
</div>
|
</view>
|
||||||
<div class="addressCon" v-else>
|
<view class="addressCon" v-else>
|
||||||
<div class="name">
|
<view class="name">
|
||||||
{{ systemStore.name }}
|
{{ systemStore.name }}
|
||||||
<span class="phone">{{ systemStore.phone }}</span>
|
<span class="phone">{{ systemStore.phone }}</span>
|
||||||
</div>
|
</view>
|
||||||
<div>{{ systemStore.address }}</div>
|
<view>{{ systemStore.address }}</view>
|
||||||
</div>
|
</view>
|
||||||
<div class="iconfont icon-jiantou"></div>
|
<view class="iconfont icon-jiantou"></view>
|
||||||
</div>
|
</view>
|
||||||
<view class="line">
|
<view class="line">
|
||||||
<image :src="`${$VUE_APP_RESOURCES_URL}/images/line.jpg`" />
|
<image :src="`${$VUE_APP_RESOURCES_URL}/images/line.jpg`" />
|
||||||
</view>
|
</view>
|
||||||
@@ -312,9 +312,9 @@ export default {
|
|||||||
},
|
},
|
||||||
onLoad: function() {
|
onLoad: function() {
|
||||||
let that = this
|
let that = this
|
||||||
console.log('loadddddddd')
|
|
||||||
this.$store.dispatch('getUser', true)
|
this.$store.dispatch('getUser', true)
|
||||||
that.getCartInfo()
|
that.getCartInfo()
|
||||||
|
|
||||||
console.log(that.$yroute)
|
console.log(that.$yroute)
|
||||||
if (that.$yroute.query.pinkid !== undefined) {
|
if (that.$yroute.query.pinkid !== undefined) {
|
||||||
that.pinkId = that.$yroute.query.pinkid
|
that.pinkId = that.$yroute.query.pinkid
|
||||||
@@ -355,6 +355,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.useIntegral = e.mp.detail.value[0]
|
this.useIntegral = e.mp.detail.value[0]
|
||||||
},
|
},
|
||||||
|
// 计算商品价格
|
||||||
computedPrice() {
|
computedPrice() {
|
||||||
let shipping_type = this.shipping_type
|
let shipping_type = this.shipping_type
|
||||||
postOrderComputed(this.orderGroupInfo.orderKey, {
|
postOrderComputed(this.orderGroupInfo.orderKey, {
|
||||||
@@ -377,7 +378,11 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCartInfo() {
|
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) {
|
if (!cartIds) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '参数有误',
|
title: '参数有误',
|
||||||
@@ -388,8 +393,6 @@ export default {
|
|||||||
}
|
}
|
||||||
postOrderConfirm(cartIds)
|
postOrderConfirm(cartIds)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
console.log(res, 999999)
|
|
||||||
console.log(res.data.systemStore || {}, 999999)
|
|
||||||
this.offlinePayStatus = res.data.offline_pay_status
|
this.offlinePayStatus = res.data.offline_pay_status
|
||||||
this.orderGroupInfo = res.data
|
this.orderGroupInfo = res.data
|
||||||
this.deduction = res.data.deduction
|
this.deduction = res.data.deduction
|
||||||
|
|||||||
@@ -1,38 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="return-list" ref="container">
|
<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="nav">
|
||||||
<view class="iconfont icon-yituikuan" v-if="order._status._type === -2"></view>
|
<view class="item" :class="{ on: listQuery.type === 0 }" @click="changeType(0)">
|
||||||
<view class="orderNum">订单号:{{ order.orderId }}</view>
|
<view>全部</view>
|
||||||
<view
|
</view>
|
||||||
class="item acea-row row-between-wrapper"
|
<view class="item" :class="{ on: listQuery.type === 1 }" @click="changeType(1)">
|
||||||
v-for="(cart,cartInfoIndex) in order.cartInfo"
|
<view>售后中</view>
|
||||||
:key="cartInfoIndex"
|
</view>
|
||||||
@click="goOrderDetails(order)"
|
<view class="item" :class="{ on: listQuery.type === 2 }" @click="changeType(2)">
|
||||||
>
|
<view>已完成</view>
|
||||||
<view class="pictrue">
|
</view>
|
||||||
<image :src="cart.productInfo.image" class="image" @click.stop="goGoodsCon(cart)" />
|
</view>
|
||||||
</view>
|
<!-- 商品列表 -->
|
||||||
<view class="text">
|
<view class="list">
|
||||||
<view class="acea-row row-between-wrapper">
|
<ListItem
|
||||||
<view class="name line1">{{ cart.productInfo.storeName }}</view>
|
v-for="(item,index) in orderList"
|
||||||
<view class="num">x {{ cart.cartNum }}</view>
|
:key="index"
|
||||||
</view>
|
:item="item"
|
||||||
<view
|
/>
|
||||||
class="attr line1"
|
</view>
|
||||||
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="noCart" v-if="orderList.length === 0 && page > 1">
|
<view class="noCart" v-if="orderList.length === 0 && page > 1">
|
||||||
<view class="pictrue">
|
<view class="pictrue">
|
||||||
<image :src="`${$VUE_APP_RESOURCES_URL}/images/noOrder.png`" />
|
<image :src="`${$VUE_APP_RESOURCES_URL}/images/noOrder.png`" />
|
||||||
@@ -44,56 +31,81 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getOrderList } from "@/api/order";
|
import { getOrderList } from "@/api/order";
|
||||||
|
import { getAfterSealsList } from "@/api/aftersales.js";
|
||||||
import Loading from "@/components/Loading";
|
import Loading from "@/components/Loading";
|
||||||
|
import ListItem from './listItem.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "ReturnList",
|
name: "ReturnList",
|
||||||
components: {
|
components: {
|
||||||
Loading
|
Loading,
|
||||||
|
ListItem
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
orderList: [],
|
orderList: [],
|
||||||
page: 1,
|
listQuery: {
|
||||||
limit: 20,
|
page: 1,
|
||||||
loading: false,
|
limit: 5,
|
||||||
loaded: false
|
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() {
|
mounted() {
|
||||||
this.getOrderList();
|
this.getOrderList();
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
!this.loading && this.getOrderList();
|
!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>
|
</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>
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -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>
|
||||||
</view>
|
</view>
|
||||||
<Loading :loaded="loaded" :loading="loading"></Loading>
|
<Loading :loaded="loaded" :loading="loading"></Loading>
|
||||||
<PriceChange :change="change" :orderInfo="orderInfo" v-on:closechange="changeclose($event)" v-on:savePrice="savePrice"
|
<PriceChange
|
||||||
:status="status"></PriceChange>
|
:change="change"
|
||||||
|
:orderInfo="orderInfo"
|
||||||
|
v-on:closechange="changeclose($event)"
|
||||||
|
v-on:savePrice="savePrice"
|
||||||
|
:status="status"></PriceChange>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -72,37 +72,34 @@ export default {
|
|||||||
!this.loading && this.getProductReplyList();
|
!this.loading && this.getProductReplyList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getProductReplyCount: function() {
|
getProductReplyCount () {
|
||||||
let that = this;
|
getReplyConfig(this.product_id).then(res => {
|
||||||
getReplyConfig(that.product_id).then(res => {
|
this.$set(that, "replyData", res.data);
|
||||||
that.$set(that, "replyData", res.data);
|
this.navList[0].num = res.data.sumCount;
|
||||||
that.navList[0].num = res.data.sumCount;
|
this.navList[1].num = res.data.goodCount;
|
||||||
that.navList[1].num = res.data.goodCount;
|
this.navList[2].num = res.data.inCount;
|
||||||
that.navList[2].num = res.data.inCount;
|
this.navList[3].num = res.data.poorCount;
|
||||||
that.navList[3].num = res.data.poorCount;
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getProductReplyList: function() {
|
getProductReplyList () {
|
||||||
let that = this;
|
if (this.loading) return; //阻止下次请求(false可以进行请求);
|
||||||
if (that.loading) return; //阻止下次请求(false可以进行请求);
|
if (this.loadend) return; //阻止结束当前请求(false可以进行请求);
|
||||||
if (that.loadend) return; //阻止结束当前请求(false可以进行请求);
|
this.loading = true;
|
||||||
that.loading = true;
|
let q = { page: this.page, limit: this.limit, type: this.currentActive };
|
||||||
let q = { page: that.page, limit: that.limit, type: that.currentActive };
|
getReplyList(this.product_id, q).then(res => {
|
||||||
getReplyList(that.product_id, q).then(res => {
|
this.loading = false;
|
||||||
that.loading = false;
|
|
||||||
//apply();js将一个数组插入另一个数组;
|
//apply();js将一个数组插入另一个数组;
|
||||||
that.reply.push.apply(that.reply, res.data);
|
this.reply.push.apply(this.reply, res.data);
|
||||||
that.loadend = res.data.length < that.limit; //判断所有数据是否加载完成;
|
this.loadend = res.data.length < this.limit; //判断所有数据是否加载完成;
|
||||||
that.page = that.page + 1;
|
this.page = this.page + 1;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
changeType: function(index) {
|
changeType (index) {
|
||||||
let that = this;
|
this.currentActive = index;
|
||||||
that.currentActive = index;
|
this.page = 1;
|
||||||
that.page = 1;
|
this.loadend = false;
|
||||||
that.loadend = false;
|
this.$set(this, "reply", []);
|
||||||
that.$set(that, "reply", []);
|
this.getProductReplyList();
|
||||||
that.getProductReplyList();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ export default {
|
|||||||
nows: false,
|
nows: false,
|
||||||
recommendLoading: false,
|
recommendLoading: false,
|
||||||
target: false,
|
target: false,
|
||||||
isIntegral: false,
|
isIntegral: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -189,18 +189,19 @@ export default {
|
|||||||
this.stock = 0
|
this.stock = 0
|
||||||
// this.getProductList();
|
// this.getProductList();
|
||||||
}
|
}
|
||||||
let q = that.where
|
let q = this.where
|
||||||
let getData = this.isIntegral !== 'true' ? getProducts : getProductsIntegral
|
let getData = this.isIntegral !== 'true' ? getProducts : getProductsIntegral
|
||||||
getData(q).then(res => {
|
getData(q).then(res => {
|
||||||
that.loading = false
|
this.loading = false
|
||||||
if (that.target) {
|
if (this.target) {
|
||||||
that.productList = res.data
|
this.productList = res.data
|
||||||
|
this.target = false
|
||||||
} else {
|
} else {
|
||||||
that.productList.push.apply(that.productList, res.data)
|
this.productList.push.apply(this.productList, res.data)
|
||||||
}
|
}
|
||||||
that.target = false
|
console.log(this.target)
|
||||||
that.loadend = res.data.length < that.where.limit //判断所有数据是否加载完成;
|
this.loadend = res.data.length < this.where.limit //判断所有数据是否加载完成;
|
||||||
that.where.page = that.where.page + 1
|
this.where.page = this.where.page + 1
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
submitForm: function() {
|
submitForm: function() {
|
||||||
@@ -248,27 +249,25 @@ export default {
|
|||||||
that.getProductList()
|
that.getProductList()
|
||||||
},
|
},
|
||||||
//设置where条件
|
//设置where条件
|
||||||
setWhere: function() {
|
setWhere() {
|
||||||
let that = this
|
if (this.price === 0) {
|
||||||
if (that.price === 0) {
|
this.where.priceOrder = ''
|
||||||
that.where.priceOrder = ''
|
} else if (this.price === 1) {
|
||||||
} else if (that.price === 1) {
|
this.where.priceOrder = 'asc'
|
||||||
that.where.priceOrder = 'asc'
|
} else if (this.price === 2) {
|
||||||
} else if (that.price === 2) {
|
this.where.priceOrder = 'desc'
|
||||||
that.where.priceOrder = 'desc'
|
|
||||||
}
|
}
|
||||||
if (that.stock === 0) {
|
if (this.stock === 0) {
|
||||||
that.where.salesOrder = ''
|
this.where.salesOrder = ''
|
||||||
} else if (that.stock === 1) {
|
} else if (this.stock === 1) {
|
||||||
that.where.salesOrder = 'asc'
|
this.where.salesOrder = 'asc'
|
||||||
} else if (that.stock === 2) {
|
} else if (this.stock === 2) {
|
||||||
that.where.salesOrder = 'desc'
|
this.where.salesOrder = 'desc'
|
||||||
}
|
}
|
||||||
that.where.news = that.nows ? '1' : '0'
|
this.where.news = this.nows ? '1' : '0'
|
||||||
},
|
},
|
||||||
switchTap: function() {
|
switchTap() {
|
||||||
let that = this
|
this.Switch = !this.Switch
|
||||||
that.Switch = !that.Switch
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -520,5 +520,9 @@
|
|||||||
}
|
}
|
||||||
.shoppingCart{
|
.shoppingCart{
|
||||||
position: relative;
|
position: relative;
|
||||||
|
.list{
|
||||||
|
margin-top: 150rpx;
|
||||||
|
padding-top: 15rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="ChangePassword">
|
<view class="ChangePassword">
|
||||||
<view class="phone">
|
<!-- <view class="phone">
|
||||||
当前手机号:
|
当前手机号:
|
||||||
<input type="text" v-model="phone" disabled />
|
<input type="text" v-model="phone" disabled />
|
||||||
</view>
|
</view> -->
|
||||||
|
<view class="title">
|
||||||
|
通过手机号来修改密码:
|
||||||
|
</view>
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<input type="password" placeholder="设置新密码" v-model="password" />
|
<input type="password" placeholder="设置新密码" v-model="password" />
|
||||||
@@ -13,18 +16,13 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between-wrapper">
|
<view class="item acea-row row-between-wrapper">
|
||||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
|
<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>
|
</view>
|
||||||
<view class="confirmBnt bg-color-red" @click="confirm">确认修改</view>
|
<view class="confirmBnt bg-color-red" @click="confirm">确认修改</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<style scoped lang="less">
|
|
||||||
.ChangePassword .phone input {
|
|
||||||
width: 2 * 100rpx;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script>
|
<script>
|
||||||
// import { mapGetters } from "vuex";
|
// import { mapGetters } from "vuex";
|
||||||
import sendVerifyCode from '@/mixins/SendVerifyCode'
|
import sendVerifyCode from '@/mixins/SendVerifyCode'
|
||||||
@@ -84,13 +82,24 @@ export default {
|
|||||||
password: that.password,
|
password: that.password,
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
})
|
})
|
||||||
|
this.$yrouter.replace({
|
||||||
// that.$yrouter.push({ path: "/pages/user/Login/index" });
|
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 => {
|
.catch(res => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -133,3 +142,27 @@ export default {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</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>
|
||||||
|
|||||||
+286
-217
@@ -1,57 +1,58 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="register absolute">
|
<view class="register absolute">
|
||||||
<view class="whiteBg" v-if="formItem === 1">
|
<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"
|
<view class="item" :class="current === index ? 'on' : ''" v-for="(item, index) in navList"
|
||||||
@click="navTap(index)" :key="index">{{ item }}</view>
|
@click="navTap(index)" :key="index">{{ item }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 手机号登录 -->
|
||||||
<view class="list" :hidden="current !== 0">
|
<view class="list" :hidden="current !== 0">
|
||||||
<form @submit.prevent="submit">
|
<form @submit.prevent="submit">
|
||||||
<view class="item">
|
<view class="item getPhoneCode">
|
||||||
<view class="acea-row row-between-wrapper">
|
<view class="phoneInput acea-row row-between-wrapper">
|
||||||
<!-- <svg class="icon" aria-hidden="true">
|
<input type="text" placeholder="输入手机号码"
|
||||||
<use xlink:href="#icon-phone_" />
|
v-model="account" required/>
|
||||||
</svg>-->
|
|
||||||
<input type="text" placeholder="输入手机号码" v-model="account" required />
|
|
||||||
</view>
|
</view>
|
||||||
|
<view class="phoneCode" @click="sendCode">
|
||||||
|
{{ clockText }}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="acea-row row-between-wrapper">
|
<view class="acea-row row-between-wrapper">
|
||||||
<!-- <svg class="icon" aria-hidden="true">
|
<input type="text" placeholder="请输入验证码" v-model="captcha" required />
|
||||||
<use xlink:href="#icon-code_" />
|
<!-- <input type="password" placeholder="填写登录密码" v-model="password" required /> -->
|
||||||
</svg>-->
|
|
||||||
<input type="password" placeholder="填写登录密码" v-model="password" required />
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</form>
|
</form>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 账号密码登录 -->
|
||||||
<view class="list" :hidden="current !== 1">
|
<view class="list" :hidden="current !== 1">
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="acea-row row-between-wrapper">
|
<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" />
|
<input type="text" placeholder="输入手机号码" v-model="account" />
|
||||||
</view>
|
</view>
|
||||||
</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">
|
<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" />
|
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
|
||||||
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''"
|
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''"
|
||||||
@click="code">{{ text }}</button>
|
@click="code">{{ text }}</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="logon" @click="loginMobile" :hidden="current !== 1">登录</view>
|
<view class="logon" @click="loginMobile" :hidden="current === 1">手机号登录</view>
|
||||||
<view class="logon" @click="submit" :hidden="current === 1">登录</view>
|
<view class="logon" @click="submit" :hidden="current !== 1">登录</view>
|
||||||
<view class="tip">
|
<view class="tip">
|
||||||
没有账号?
|
第一次使用?
|
||||||
<text @click="formItem = 2" class="font-color-red">立即注册</text>
|
<text @click="formItem = 2" class="font-color-red">立即注册</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 注册 -->
|
||||||
<view class="whiteBg" v-else>
|
<view class="whiteBg" v-else>
|
||||||
<view class="title acea-row row-between-wrapper">
|
<view class="title acea-row row-between-wrapper">
|
||||||
<view class="item on">注册账号</view>
|
<view class="item on">注册账号</view>
|
||||||
@@ -133,210 +134,278 @@
|
|||||||
mixins: [sendVerifyCode],
|
mixins: [sendVerifyCode],
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
navList: ["账号登录"],
|
navList: ["手机号登录", "密码登录"],
|
||||||
|
// navList: ["手机号登录",],
|
||||||
current: 0,
|
current: 0,
|
||||||
account: "",
|
account: "",
|
||||||
password: "",
|
password: "",
|
||||||
captcha: "",
|
captcha: "",
|
||||||
inviteCode: "",
|
inviteCode: "",
|
||||||
formItem: 1,
|
formItem: 1,
|
||||||
type: "login"
|
type: "login",
|
||||||
|
timer: null,
|
||||||
|
clock: 60,
|
||||||
|
clockText: '验证码'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async loginMobile() {
|
async loginMobile() {
|
||||||
var that = this;
|
var that = this;
|
||||||
const {
|
const {
|
||||||
account,
|
account,
|
||||||
captcha
|
captcha
|
||||||
} = that;
|
} = that;
|
||||||
try {
|
try {
|
||||||
await that
|
await that
|
||||||
.$validator({
|
.$validator({
|
||||||
account: [
|
account: [
|
||||||
required(required.message("手机号码")),
|
required(required.message("手机号码")),
|
||||||
chs_phone(chs_phone.message())
|
chs_phone(chs_phone.message())
|
||||||
],
|
],
|
||||||
captcha: [
|
captcha: [
|
||||||
required(required.message("验证码")),
|
required(required.message("验证码")),
|
||||||
alpha_num(alpha_num.message("验证码"))
|
alpha_num(alpha_num.message("验证码"))
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
.validate({
|
.validate({
|
||||||
account,
|
account,
|
||||||
captcha
|
captcha
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return validatorDefaultCatch(e);
|
return validatorDefaultCatch(e);
|
||||||
}
|
}
|
||||||
loginMobile({
|
const res = await loginMobile({
|
||||||
phone: that.account,
|
account: that.account,
|
||||||
captcha: that.captcha,
|
captcha: that.captcha,
|
||||||
spread: cookie.get("spread")
|
spread: cookie.get("spread")
|
||||||
})
|
})
|
||||||
.then(res => {
|
if (res.status === 200) {
|
||||||
var data = res.data;
|
this.$store.commit("login", res.data.token, dayjs(res.data.expires_time));
|
||||||
that.$store.commit("login", data.token, dayjs(data.expires_time));
|
handleGetUserInfo();
|
||||||
handleGetUserInfo();
|
} else {
|
||||||
})
|
uni.showToast({
|
||||||
.catch(err => {
|
title: res.msg || res.response.data.msg || err.response.data.message,
|
||||||
uni.showToast({
|
icon: "none",
|
||||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
duration: 2000
|
||||||
icon: "none",
|
});
|
||||||
duration: 2000
|
}
|
||||||
});
|
// .then(res => {
|
||||||
});
|
// that.$store.commit("login", res.data.token, dayjs(res.data.expires_time));
|
||||||
},
|
// handleGetUserInfo();
|
||||||
async register() {
|
// })
|
||||||
var that = this;
|
// .catch(err => {
|
||||||
const {
|
// console.log(err)
|
||||||
account,
|
// uni.showToast({
|
||||||
captcha,
|
// title: err.msg || err.response.data.msg || err.response.data.message,
|
||||||
password
|
// icon: "none",
|
||||||
} = that;
|
// duration: 2000
|
||||||
try {
|
// });
|
||||||
await that
|
// });
|
||||||
.$validator({
|
},
|
||||||
account: [
|
async register() {
|
||||||
required(required.message("手机号码")),
|
var that = this;
|
||||||
chs_phone(chs_phone.message())
|
const {
|
||||||
],
|
account,
|
||||||
captcha: [
|
captcha,
|
||||||
required(required.message("验证码")),
|
password
|
||||||
alpha_num(alpha_num.message("验证码"))
|
} = that;
|
||||||
],
|
try {
|
||||||
password: [
|
await that
|
||||||
required(required.message("密码")),
|
.$validator({
|
||||||
attrs.range([6, 16], attrs.range.message("密码")),
|
account: [
|
||||||
alpha_num(alpha_num.message("密码"))
|
required(required.message("手机号码")),
|
||||||
]
|
chs_phone(chs_phone.message())
|
||||||
})
|
],
|
||||||
.validate({
|
captcha: [
|
||||||
account,
|
required(required.message("验证码")),
|
||||||
captcha,
|
alpha_num(alpha_num.message("验证码"))
|
||||||
password
|
],
|
||||||
});
|
password: [
|
||||||
} catch (e) {
|
required(required.message("密码")),
|
||||||
return validatorDefaultCatch(e);
|
attrs.range([6, 16], attrs.range.message("密码")),
|
||||||
}
|
alpha_num(alpha_num.message("密码"))
|
||||||
register({
|
]
|
||||||
account: that.account,
|
})
|
||||||
captcha: that.captcha,
|
.validate({
|
||||||
password: that.password,
|
account,
|
||||||
inviteCode: that.inviteCode,
|
captcha,
|
||||||
spread: cookie.get("spread")
|
password
|
||||||
})
|
});
|
||||||
.then(res => {
|
} catch (e) {
|
||||||
uni.showToast({
|
return validatorDefaultCatch(e);
|
||||||
title: res.msg,
|
}
|
||||||
icon: "success",
|
register({
|
||||||
duration: 2000
|
account: that.account,
|
||||||
});
|
captcha: that.captcha,
|
||||||
that.formItem = 1;
|
password: that.password,
|
||||||
})
|
inviteCode: that.inviteCode,
|
||||||
.catch(err => {
|
spread: cookie.get("spread")
|
||||||
uni.showToast({
|
})
|
||||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
.then(res => {
|
||||||
icon: "none",
|
uni.showToast({
|
||||||
duration: 2000
|
title: res.msg,
|
||||||
});
|
icon: "success",
|
||||||
});
|
duration: 2000
|
||||||
},
|
});
|
||||||
async code() {
|
that.formItem = 1;
|
||||||
var that = this;
|
})
|
||||||
const {
|
.catch(err => {
|
||||||
account
|
uni.showToast({
|
||||||
} = that;
|
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||||
try {
|
icon: "none",
|
||||||
await that
|
duration: 2000
|
||||||
.$validator({
|
});
|
||||||
account: [
|
});
|
||||||
required(required.message("手机号码")),
|
},
|
||||||
chs_phone(chs_phone.message())
|
// 获取验证码
|
||||||
]
|
async code() {
|
||||||
})
|
const {
|
||||||
.validate({
|
account
|
||||||
account
|
} = this;
|
||||||
});
|
try {
|
||||||
} catch (e) {
|
await this
|
||||||
return validatorDefaultCatch(e);
|
.$validator({
|
||||||
}
|
account: [
|
||||||
if (that.formItem == 2) that.type = "register";
|
required(required.message("手机号码")),
|
||||||
await registerVerify({
|
chs_phone(chs_phone.message())
|
||||||
phone: that.account,
|
]
|
||||||
type: that.type
|
})
|
||||||
})
|
.validate({
|
||||||
.then(res => {
|
account
|
||||||
uni.showToast({
|
});
|
||||||
title: res.msg,
|
} catch (e) {
|
||||||
icon: "success",
|
return validatorDefaultCatch(e);
|
||||||
duration: 2000
|
}
|
||||||
});
|
if (this.formItem == 2) this.type = "register";
|
||||||
that.sendCode();
|
this.showCode()
|
||||||
})
|
},
|
||||||
.catch(err => {
|
// 手机号登录获取验证码
|
||||||
uni.showToast({
|
async sendCode () {
|
||||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
const {
|
||||||
icon: "none",
|
account
|
||||||
duration: 2000
|
} = this;
|
||||||
});
|
try {
|
||||||
});
|
await this
|
||||||
},
|
.$validator({
|
||||||
navTap: function (index) {
|
account: [
|
||||||
this.current = index;
|
required(required.message("手机号码")),
|
||||||
},
|
chs_phone(chs_phone.message())
|
||||||
async submit() {
|
]
|
||||||
const {
|
})
|
||||||
account,
|
.validate({
|
||||||
password
|
account
|
||||||
} = this;
|
});
|
||||||
try {
|
} catch (e) {
|
||||||
await this.$validator({
|
return validatorDefaultCatch(e);
|
||||||
account: [
|
}
|
||||||
required(required.message("账号")),
|
// 倒计时
|
||||||
attrs.range([5, 16], attrs.range.message("账号")),
|
if (this.clock !== 60) {
|
||||||
alpha_num(alpha_num.message("账号"))
|
return
|
||||||
],
|
}
|
||||||
password: [
|
this.clock--
|
||||||
required(required.message("密码")),
|
this.clockText = `${this.clock} 秒`
|
||||||
attrs.range([6, 16], attrs.range.message("密码")),
|
this.timer = setInterval(() => {
|
||||||
alpha_num(alpha_num.message("密码"))
|
if (parseInt(this.clock) === 1) {
|
||||||
]
|
clearTimeout(this.timer)
|
||||||
}).validate({
|
this.clock = 60
|
||||||
account,
|
this.clockText = '获取验证码'
|
||||||
password
|
return
|
||||||
});
|
}
|
||||||
} catch (e) {
|
this.clock--
|
||||||
return validatorDefaultCatch(e);
|
if (this.clock < 10) this.clock = `0${this.clock}`
|
||||||
}
|
this.clockText = `${this.clock} 秒`
|
||||||
|
}, 1000)
|
||||||
login({
|
this.showCode()
|
||||||
username: account,
|
},
|
||||||
password,
|
// 验证码请求
|
||||||
spread: cookie.get("spread")
|
showCode() {
|
||||||
})
|
return registerVerify({
|
||||||
.then(({
|
phone: this.account,
|
||||||
data
|
type: this.type
|
||||||
}) => {
|
})
|
||||||
this.$store.commit("login", data.token, dayjs(data.expires_time));
|
.then(res => {
|
||||||
handleGetUserInfo();
|
uni.showToast({
|
||||||
// let replace=this.$yroute.query.replace
|
title: res.msg,
|
||||||
// if(replace){
|
icon: "success",
|
||||||
|
duration: 2000
|
||||||
// }
|
});
|
||||||
// this.$yrouter.replace({
|
this.sendCode();
|
||||||
// path: this.$yroute.query.replace || '/pages/home/index'
|
})
|
||||||
// });
|
.catch(err => {
|
||||||
})
|
uni.showToast({
|
||||||
.catch(err => {
|
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||||
console.log(err);
|
icon: "none",
|
||||||
uni.showToast({
|
duration: 2000
|
||||||
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>
|
</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>
|
||||||
|
|||||||
@@ -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>
|
<template>
|
||||||
<view class="personal-data">
|
<view class="personal-data">
|
||||||
<view class="wrapper">
|
<view class="wrapper">
|
||||||
<view class="wrapList">
|
<view class="wrapList">
|
||||||
<view class="item acea-row row-between-wrapper on">
|
<view class="item acea-row row-between-wrapper on">
|
||||||
<view class="picTxt acea-row row-between-wrapper">
|
<view class="picTxt acea-row row-between-wrapper">
|
||||||
<view class="pictrue" @tap="chooseImage">
|
<view class="pictrue" @tap="chooseImage">
|
||||||
<div class="pictrue">
|
<div class="pictrue">
|
||||||
<img :src="avatar" />
|
<img :src="avatar" />
|
||||||
</div>
|
</div>
|
||||||
<image :src="`${$VUE_APP_RESOURCES_URL}/images/alter.png`" class="alter" />
|
<image :src="`${$VUE_APP_RESOURCES_URL}/images/alter.png`" class="alter" />
|
||||||
</view>
|
</view>
|
||||||
<view class="text">
|
<view class="text">
|
||||||
<view class="name line1">{{ userInfo.nickname }}</view>
|
<view class="name line1">{{ userInfo.nickname }}</view>
|
||||||
<view class="phone">
|
<view class="phone">
|
||||||
绑定手机号:
|
绑定手机号:
|
||||||
<text v-if="userInfo.phone">{{ userInfo.phone }}</text>
|
<text v-if="userInfo.phone">{{ userInfo.phone }}</text>
|
||||||
<text v-else>未绑定</text>
|
<text v-else>未绑定</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view class="item acea-row row-between-wrapper">
|
<view class="item acea-row row-between-wrapper">
|
||||||
<view>昵称</view>
|
<view>昵称</view>
|
||||||
<view class="input">
|
<view class="input">
|
||||||
<input type="text" v-model="userInfo.nickname" />
|
<input type="text" v-model="userInfo.nickname" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between-wrapper">
|
<view class="item acea-row row-between-wrapper">
|
||||||
<view>ID号</view>
|
<view>ID号</view>
|
||||||
<view class="input acea-row row-between-wrapper">
|
<view class="input acea-row row-between-wrapper">
|
||||||
<input type="text" :value="userInfo.uid" disabled class="id" />
|
<input type="text" :value="userInfo.uid" disabled class="id" />
|
||||||
<text class="iconfont icon-suozi"></text>
|
<text class="iconfont icon-suozi"></text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between-wrapper">
|
<view class="item acea-row row-between-wrapper">
|
||||||
<view>手机号</view>
|
<view>手机号</view>
|
||||||
<view class="input">
|
<view class="input">
|
||||||
<input type="text" v-if="userInfo.phone" v-model="userInfo.phone" />
|
<!-- <input type="text" v-model="userInfo.phone" placeholder="未绑定"/> -->
|
||||||
<input type="text" v-else value="未绑定" disabled class="id" />
|
<input type="text" v-if="userInfo.phone" v-model="userInfo.phone" placeholder="未绑定"/>
|
||||||
</view>
|
<input type="text" v-else value="未绑定" disabled class="id" />
|
||||||
</view>
|
</view>
|
||||||
<!--
|
</view>
|
||||||
<view class="item acea-row row-between-wrapper" @click="goChangePassword()">
|
<view class="item acea-row row-between-wrapper" @click="goChangePassword()">
|
||||||
<view>密码</view>
|
<view>密码</view>
|
||||||
<view class="input acea-row row-between-wrapper">
|
<view class="input acea-row row-between-wrapper">
|
||||||
@@ -51,7 +51,6 @@
|
|||||||
<text class="iconfont icon-suozi"></text>
|
<text class="iconfont icon-suozi"></text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
-->
|
|
||||||
</view>
|
</view>
|
||||||
<view class="modifyBnt bg-color-red" @click="submit">保存修改</view>
|
<view class="modifyBnt bg-color-red" @click="submit">保存修改</view>
|
||||||
<!-- #ifndef MP-WEIXIN -->
|
<!-- #ifndef MP-WEIXIN -->
|
||||||
@@ -156,7 +155,6 @@ export default {
|
|||||||
},
|
},
|
||||||
chooseImage() {
|
chooseImage() {
|
||||||
chooseImage((img) => {
|
chooseImage((img) => {
|
||||||
console.log(img);
|
|
||||||
this.avatar = img;
|
this.avatar = img;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
+132
-61
@@ -1,7 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="user">
|
<view class="user">
|
||||||
<view v-if="$store.getters.token || userInfo.uid">
|
<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="picTxt acea-row row-between-wrapper">
|
||||||
<view class="pictrue">
|
<view class="pictrue">
|
||||||
<image :src="userInfo.avatar" />
|
<image :src="userInfo.avatar" />
|
||||||
@@ -19,15 +23,15 @@
|
|||||||
<text class="iconfont icon-bianji1"></text>
|
<text class="iconfont icon-bianji1"></text>
|
||||||
</view>
|
</view>
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #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>
|
<text>绑定手机号</text>
|
||||||
</button>
|
</button> -->
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|
||||||
<!-- #ifndef MP-WEIXIN -->
|
<!-- #ifndef MP-WEIXIN -->
|
||||||
<button class="binding" @click="goBindPhone()" v-else>
|
<!-- <button class="binding" @click="goBindPhone()" v-else>
|
||||||
<text>绑定手机号</text>
|
<text>绑定手机号</text>
|
||||||
</button>
|
</button> -->
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -60,7 +64,7 @@
|
|||||||
<text class="iconfont icon-jiantou"></text>
|
<text class="iconfont icon-jiantou"></text>
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</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 @click="goMyOrder(0)" class="item">
|
||||||
<view class="pictrue">
|
<view class="pictrue">
|
||||||
<image :src="`${$VUE_APP_RESOURCES_URL}/images/dfk.png`" />
|
<image :src="`${$VUE_APP_RESOURCES_URL}/images/dfk.png`" />
|
||||||
@@ -128,11 +132,11 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { mapState, mapGetters, mapMutations, mapActions } from 'vuex'
|
import { mapState, mapGetters, mapMutations, mapActions } from 'vuex'
|
||||||
import { getUserInfo, getMenuUser, bindingPhone, wxappBindingPhone } from '@/api/user'
|
import { getUserInfo, getMenuUser, wxappAuth, bindingPhone, wxappBindingPhone, wxappGetUserInfo } from '@/api/user'
|
||||||
import { isWeixin, VUE_APP_RESOURCES_URL } from '@/utils'
|
import { isWeixin, VUE_APP_RESOURCES_URL, parseQuery, getProvider } from '@/utils'
|
||||||
import cookie from '@/utils/store/cookie'
|
|
||||||
import SwitchWindow from '@/components/SwitchWindow'
|
import SwitchWindow from '@/components/SwitchWindow'
|
||||||
import Authorization from '@/pages/authorization/index'
|
import Authorization from '@/pages/authorization/index'
|
||||||
|
import cookie from '@/utils/store/cookie'
|
||||||
|
|
||||||
const NAME = 'User'
|
const NAME = 'User'
|
||||||
|
|
||||||
@@ -145,14 +149,23 @@ export default {
|
|||||||
props: {},
|
props: {},
|
||||||
data: function() {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
MyMenus: [],
|
canIUseGetUserProfile: false,
|
||||||
switchActive: false,
|
MyMenus: [],
|
||||||
isWeixin: false,
|
switchActive: false,
|
||||||
|
isWeixin: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: mapGetters(['userInfo']),
|
computed: mapGetters(['userInfo']),
|
||||||
|
onLoad() {
|
||||||
|
if (wx.getUserProfile) {
|
||||||
|
this.canIUseGetUserProfile = true
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations(['updateAuthorizationPage']),
|
...mapMutations(['updateAuthorizationPage']),
|
||||||
|
toLogin() {
|
||||||
|
this.$yrouter.push('/pages/user/Login/index')
|
||||||
|
},
|
||||||
goReturnList() {
|
goReturnList() {
|
||||||
this.$yrouter.push('/pages/order/ReturnList/index')
|
this.$yrouter.push('/pages/order/ReturnList/index')
|
||||||
},
|
},
|
||||||
@@ -165,9 +178,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
goBindPhone() {
|
goBindPhone() {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push('/pages/user/BindingPhone/index')
|
||||||
path: '/pages/user/BindingPhone/index',
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
goUserCoupon() {
|
goUserCoupon() {
|
||||||
this.$yrouter.push('/pages/user/coupon/UserCoupon/index')
|
this.$yrouter.push('/pages/user/coupon/UserCoupon/index')
|
||||||
@@ -179,45 +190,41 @@ export default {
|
|||||||
this.$yrouter.push('/pages/user/promotion/UserPromotion/index')
|
this.$yrouter.push('/pages/user/promotion/UserPromotion/index')
|
||||||
},
|
},
|
||||||
goUserAccount() {
|
goUserAccount() {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push('/pages/user/UserAccount/index')
|
||||||
path: '/pages/user/UserAccount/index',
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
goPersonalData() {
|
goPersonalData() {
|
||||||
this.$yrouter.push('/pages/user/PersonalData/index')
|
this.$yrouter.push('/pages/user/PersonalData/index')
|
||||||
},
|
},
|
||||||
getPhoneNumber: function(e) {
|
getPhoneNumber (e) {
|
||||||
let thit = this
|
// 判断一下这里是不是小程序 如果是小程序,走获取微信手机号进行绑定
|
||||||
console.log(e)
|
if (e.mp.detail.errMsg == 'getPhoneNumber:ok') {
|
||||||
// 判断一下这里是不是小程序 如果是小程序,走获取微信手机号进行绑定
|
uni.showLoading({
|
||||||
if (e.mp.detail.errMsg == 'getPhoneNumber:ok') {
|
title: '绑定中',
|
||||||
uni.showLoading({
|
})
|
||||||
title: '绑定中',
|
wxappBindingPhone({
|
||||||
})
|
encryptedData: e.mp.detail.encryptedData,
|
||||||
wxappBindingPhone({
|
iv: e.mp.detail.iv,
|
||||||
encryptedData: e.mp.detail.encryptedData,
|
})
|
||||||
iv: e.mp.detail.iv,
|
.then(res => {
|
||||||
})
|
// this.User();
|
||||||
.then(res => {
|
this.$store.dispatch('userInfo', true)
|
||||||
// this.User();
|
uni.hideLoading()
|
||||||
thit.$store.dispatch('userInfo', true)
|
uni.showToast({
|
||||||
uni.hideLoading()
|
title: res.msg,
|
||||||
uni.showToast({
|
icon: 'success',
|
||||||
title: res.msg,
|
duration: 2000,
|
||||||
icon: 'success',
|
})
|
||||||
duration: 2000,
|
})
|
||||||
})
|
.catch(error => {
|
||||||
})
|
uni.hideLoading()
|
||||||
.catch(error => {
|
this.$store.dispatch('userInfo', true)
|
||||||
uni.hideLoading()
|
console.log(error)
|
||||||
thit.$store.dispatch('userInfo', true)
|
uni.showToast({
|
||||||
console.log(error)
|
title: error.msg || error.response.data.msg || error.response.data.message,
|
||||||
uni.showToast({
|
icon: 'none',
|
||||||
title: error.msg || error.response.data.msg || error.response.data.message,
|
duration: 2000,
|
||||||
icon: 'none',
|
})
|
||||||
duration: 2000,
|
})
|
||||||
})
|
|
||||||
})
|
|
||||||
// // 获取当前环境的服务商
|
// // 获取当前环境的服务商
|
||||||
// uni.getProvider({
|
// uni.getProvider({
|
||||||
// service: "oauth",
|
// service: "oauth",
|
||||||
@@ -233,7 +240,7 @@ export default {
|
|||||||
// })
|
// })
|
||||||
// .then(res => {
|
// .then(res => {
|
||||||
// // this.User();
|
// // this.User();
|
||||||
// thit.$store.dispatch("userInfo", true);
|
// this.$store.dispatch("userInfo", true);
|
||||||
// uni.hideLoading();
|
// uni.hideLoading();
|
||||||
// uni.showToast({
|
// uni.showToast({
|
||||||
// title: res.msg,
|
// title: res.msg,
|
||||||
@@ -243,7 +250,7 @@ export default {
|
|||||||
// })
|
// })
|
||||||
// .catch(error => {
|
// .catch(error => {
|
||||||
// uni.hideLoading();
|
// uni.hideLoading();
|
||||||
// thit.$store.dispatch("userInfo", true);
|
// this.$store.dispatch("userInfo", true);
|
||||||
// console.log(error);
|
// console.log(error);
|
||||||
// uni.showToast({
|
// uni.showToast({
|
||||||
// title: error.msg ||
|
// title: error.msg ||
|
||||||
@@ -264,30 +271,81 @@ export default {
|
|||||||
// reject("获取环境服务商失败");
|
// reject("获取环境服务商失败");
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
} else {
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '已拒绝授权',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 获取用户授权,读取头像、昵称
|
||||||
|
getUserInfo(data) {
|
||||||
|
if (data.detail.errMsg == 'getUserInfo:fail auth deny') {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '已拒绝授权',
|
title: '取消授权',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000,
|
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
|
this.switchActive = data
|
||||||
},
|
},
|
||||||
MenuUser: function() {
|
// 获取用户信息
|
||||||
let that = this
|
MenuUser() {
|
||||||
getMenuUser()
|
getMenuUser()
|
||||||
.then(res => {
|
.then(res => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
that.MyMenus = res.data.routine_my_menus
|
this.MyMenus = res.data.routine_my_menus
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
console.log(error)
|
console.log(error)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goPages: function(index) {
|
goPages(index) {
|
||||||
let url = this.MyMenus[index].uniapp_url
|
let url = this.MyMenus[index].uniapp_url
|
||||||
if (url === '/pages/user/promotion/UserPromotion/index' && this.userInfo.statu === 1) {
|
if (url === '/pages/user/promotion/UserPromotion/index' && this.userInfo.statu === 1) {
|
||||||
if (!this.userInfo.isPromoter) {
|
if (!this.userInfo.isPromoter) {
|
||||||
@@ -322,7 +380,7 @@ export default {
|
|||||||
path: this.MyMenus[index].uniapp_url,
|
path: this.MyMenus[index].uniapp_url,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goPages2: function() {
|
goPages2() {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: '/pages/shop/GoodsList/index',
|
path: '/pages/shop/GoodsList/index',
|
||||||
query: {
|
query: {
|
||||||
@@ -357,6 +415,19 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<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 {
|
.footer-line-height {
|
||||||
height: 1 * 100rpx;
|
height: 1 * 100rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,18 +97,17 @@ export default {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getUseCoupons: function() {
|
getUseCoupons() {
|
||||||
let that = this
|
if (this.loading) return //阻止下次请求(false可以进行请求);
|
||||||
if (that.loading) return //阻止下次请求(false可以进行请求);
|
if (this.loadend) return //阻止结束当前请求(false可以进行请求);
|
||||||
if (that.loadend) return //阻止结束当前请求(false可以进行请求);
|
this.loading = true
|
||||||
that.loading = true
|
let q = { page: this.page, limit: this.limit }
|
||||||
let q = { page: that.page, limit: that.limit }
|
|
||||||
getCoupon(q).then(res => {
|
getCoupon(q).then(res => {
|
||||||
that.loading = false
|
this.loading = false
|
||||||
//apply();js将一个数组插入另一个数组;
|
//apply();js将一个数组插入另一个数组;
|
||||||
that.couponsList.push.apply(that.couponsList, res.data)
|
this.couponsList.push.apply(this.couponsList, res.data)
|
||||||
that.loadend = res.data.length < that.limit //判断所有数据是否加载完成;
|
this.loadend = res.data.length < this.limit //判断所有数据是否加载完成;
|
||||||
that.page = that.page + 1
|
this.page = this.page + 1
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -7,9 +7,9 @@
|
|||||||
<image :src="userInfo.avatar" />
|
<image :src="userInfo.avatar" />
|
||||||
</view>
|
</view>
|
||||||
<view class="text">
|
<view class="text">
|
||||||
<view class="line1">{{ userInfo.nickname }}</view>
|
<view class="line1">{{ userInfo.nickname || '' }}</view>
|
||||||
<view class="integral acea-row">
|
<view class="integral acea-row">
|
||||||
<text>积分: {{ userInfo.integral }}</text>
|
<text>积分: {{ userInfo.integral || 0 }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ const vuexStore = new Vuex.Store({
|
|||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
login(state, token, expires_time) {
|
login(state, token, expires_time) {
|
||||||
|
console.log('设置token')
|
||||||
state.token = token
|
state.token = token
|
||||||
cookie.set(loginKey, token, expires_time)
|
cookie.set(loginKey, token, expires_time)
|
||||||
},
|
},
|
||||||
|
|||||||
+7
-10
@@ -2,7 +2,7 @@ import Vue from 'vue'
|
|||||||
|
|
||||||
// import MpvueRouterPatch from 'mpvue-router-patch'
|
// import MpvueRouterPatch from 'mpvue-router-patch'
|
||||||
// Vue.use(MpvueRouterPatch)
|
// Vue.use(MpvueRouterPatch)
|
||||||
import { wxappAuth, getUserInfo } from '@/api/user'
|
import { wxappAuth, getUserInfo, wxappBindingPhone } from '@/api/user'
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import cookie from '@/utils/store/cookie'
|
import cookie from '@/utils/store/cookie'
|
||||||
@@ -164,7 +164,7 @@ export const getProvider = service => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.log(error)
|
console.log('167',error)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,7 +196,7 @@ export const login = loginInfo => {
|
|||||||
auth(code)
|
auth(code)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
let redirect = cookie.get('redirect').replace(/\ /g, '')
|
let redirect = cookie.get('redirect').replace(/\ /g, '')
|
||||||
console.log(redirect)
|
console.log('199',redirect)
|
||||||
if (redirect) {
|
if (redirect) {
|
||||||
redirect = redirect.split('/pages')[1]
|
redirect = redirect.split('/pages')[1]
|
||||||
if (!redirect) {
|
if (!redirect) {
|
||||||
@@ -286,9 +286,8 @@ export const login = loginInfo => {
|
|||||||
reject('获取用户信息失败')
|
reject('获取用户信息失败')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => { // 登录接口调用失败
|
||||||
console.log(error)
|
console.log(error)
|
||||||
console.log('登录接口调用失败')
|
|
||||||
reject('登录接口调用失败')
|
reject('登录接口调用失败')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -299,18 +298,17 @@ export const login = loginInfo => {
|
|||||||
uni.getUserInfo({
|
uni.getUserInfo({
|
||||||
provider: provider,
|
provider: provider,
|
||||||
success: function(user) {
|
success: function(user) {
|
||||||
console.log(user)
|
|
||||||
console.log('获取用户信息成功')
|
console.log('获取用户信息成功')
|
||||||
console.log('开始调用登录接口')
|
console.log('开始调用登录接口')
|
||||||
wxappAuth({
|
wxappAuth({
|
||||||
|
// phone: user.phone
|
||||||
encryptedData: user.encryptedData,
|
encryptedData: user.encryptedData,
|
||||||
iv: user.iv,
|
iv: user.iv,
|
||||||
code: code,
|
code: code,
|
||||||
spread: cookie.get('spread'),
|
spread: cookie.get('spread'),
|
||||||
})
|
})
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
console.log('登录接口调用成功')
|
console.log('登录成功,开始处理登录信息保存,并获取用户详情')
|
||||||
console.log('开始处理登录信息保存,并获取用户详情')
|
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
store.commit('login', data.token, dayjs(data.expires_time))
|
store.commit('login', data.token, dayjs(data.expires_time))
|
||||||
store.dispatch('userInfo', true)
|
store.dispatch('userInfo', true)
|
||||||
@@ -356,7 +354,6 @@ export const handleGetUserInfo = () => {
|
|||||||
console.log('获取用户信息')
|
console.log('获取用户信息')
|
||||||
store.dispatch('setUserInfo', res.data)
|
store.dispatch('setUserInfo', res.data)
|
||||||
console.log('获取用户信息后跳转回显的页面')
|
console.log('获取用户信息后跳转回显的页面')
|
||||||
|
|
||||||
let redirect = cookie.get('redirect').replace(/\ /g, '')
|
let redirect = cookie.get('redirect').replace(/\ /g, '')
|
||||||
if (redirect) {
|
if (redirect) {
|
||||||
reLaunch({
|
reLaunch({
|
||||||
@@ -527,7 +524,7 @@ export const handleLoginStatus = (location, complete, fail, success) => {
|
|||||||
|
|
||||||
// 是否可以访问
|
// 是否可以访问
|
||||||
let isAuth = false
|
let isAuth = false
|
||||||
console.log('即将跳转', location, parseUrl(location))
|
// console.log('即将跳转', location, parseUrl(location))
|
||||||
|
|
||||||
// 从 location 中获取当前url,location typeof string || object
|
// 从 location 中获取当前url,location typeof string || object
|
||||||
let path = ''
|
let path = ''
|
||||||
|
|||||||
+14
-3
@@ -20,6 +20,16 @@ import cookie from '@/utils/store/cookie'
|
|||||||
const fly = new Fly()
|
const fly = new Fly()
|
||||||
fly.config.baseURL = VUE_APP_API_URL
|
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(
|
fly.interceptors.response.use(
|
||||||
response => {
|
response => {
|
||||||
// console.log(response)
|
// console.log(response)
|
||||||
@@ -27,9 +37,10 @@ fly.interceptors.response.use(
|
|||||||
return response
|
return response
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
|
console.log(error)
|
||||||
if (error.toString() == 'Error: Network Error') {
|
if (error.toString() == 'Error: Network Error') {
|
||||||
console.log('————————')
|
console.log('————————')
|
||||||
console.log('发送请求失败', error)
|
console.log('请求失败', error)
|
||||||
console.log('————————')
|
console.log('————————')
|
||||||
handleLoginFailure()
|
handleLoginFailure()
|
||||||
return Promise.reject({ msg: '未登录', toLogin: true })
|
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 baseRequest(Object.assign({ url, data, method }, defaultOpt, options))
|
||||||
}
|
}
|
||||||
return request
|
return request
|
||||||
}, {})
|
}, {});
|
||||||
|
|
||||||
;['get', 'delete', 'head'].forEach(method => {
|
['get', 'delete', 'head'].forEach(method => {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param url string 接口地址
|
* @param url string 接口地址
|
||||||
|
|||||||
Reference in New Issue
Block a user