Commit 1fc672bc by 杨北旺

解决冲突

2 parents a47e1d8e f3660b39
Showing 41 changed files with 347 additions and 359 deletions
import http from './request/http'
import apis from './module/index'
const common = 'scrm.api.carlife.common.'
module.exports = {
...apis,
common: {
/**上传图片
*/
uploadImg(data) {
return http.post({
method: `${common}uploadImg`,
...data,
noSignAttr: ['file']
})
},
/**视频上传
*/
uploadVideo(data) {
return http.post({
method: `${common}uploadVideo`,
...data,
noSignAttr: ['file']
})
},
// /**根据sceneId 查参数 */
// getSceneById(data) {
// return http.post('dj.api.smartcarlife.common.getSceneById', data)
// },
/** 首页、发现列表 搜索接口 */
search(data) {
return http.post({
method: 'scrm.api.carlife.weapp.homeSearch.search',
pageSize: 10,
...data
})
},
/** 根据sap编码获取商户详情 */
getBySapCode(data) {
return http.post({
method: `scrm.api.carlife.merchant.getBySapCode`,
...data,
}, true)
},
/**获取图片版本号 */
getImgVersion() {
return http.getMock()
},
}
}
\ No newline at end of file \ No newline at end of file
import apiModules from './module/index'
module.exports = apiModules
\ No newline at end of file \ No newline at end of file
import http from '../request/http'
const common = 'scrm.api.carlife.common.'
module.exports = {
/**上传图片
*/
uploadImg(data) {
return http.post({
method: `${common}uploadImg`,
...data,
noSignAttr: ["file"],
});
},
/**视频上传
*/
uploadVideo(data) {
return http.post({
method: `${common}uploadVideo`,
...data,
noSignAttr: ["file"],
});
},
/** 首页、发现列表 搜索接口 */
search(data) {
return http.post({
method: "scrm.api.carlife.weapp.homeSearch.search",
pageSize: 10,
...data,
});
},
/** 根据sap编码获取商户详情 */
getBySapCode(data) {
return http.fetch(`scrm.api.carlife.merchant.getBySapCode`,data);
},
/**获取图片版本号 */
getImgVersion() {
return http.getMock();
},
};
import http from "../request/http";
module.exports = {
// 智能名片详情
getCardDetail(data) {
// return api.post(
// {
// method: `entmicro.api.business.card.cardDetail`,
// ...data,
// },
// true
// );
return http.fetch(`entmicro.api.business.card.cardDetail`,data);
},
}
\ No newline at end of file \ No newline at end of file
import wechatApi from './wechat' import wechatApi from './wechat'
import entmicroApi from './entmicro'
import userApi from './user' import userApi from './user'
import homeApi from './home' import homeApi from './home'
import discoveryApi from './discovery' import discoveryApi from './discovery'
...@@ -8,10 +7,10 @@ import mineApi from './mine' ...@@ -8,10 +7,10 @@ import mineApi from './mine'
import systemApi from './system' import systemApi from './system'
import couponsApi from './coupons' import couponsApi from './coupons'
import equityApi from './equity' import equityApi from './equity'
import common from './common'
module.exports = { module.exports = {
wechatApi, wechatApi,
entmicroApi,
userApi, userApi,
homeApi, homeApi,
discoveryApi, discoveryApi,
...@@ -19,5 +18,6 @@ module.exports = { ...@@ -19,5 +18,6 @@ module.exports = {
mineApi, mineApi,
systemApi, systemApi,
couponsApi, couponsApi,
equityApi equityApi,
common
} }
\ No newline at end of file \ No newline at end of file
...@@ -123,4 +123,28 @@ module.exports = { ...@@ -123,4 +123,28 @@ module.exports = {
...data ...data
}) })
}, },
//取消付款
cancelPay(orderCode) {
return api.fetch('scrm.api.shopmall.weapp.order.cancelPay', {
orderCode
})
},
/** 申请售后 */
afterSale(data) {
return api.fetch('scrm.api.shopmall.weapp.orderRefund.apply', data)
},
//申请售后待审核的订单取消售后
cancelOrder(orderCode) {
return api.fetch('scrm.api.shopmall.weapp.orderRefund.cancel',{
orderCode
})
},
/** 为售后添加退货快递信息 */
addDelivery(data) {
return api.post({
method: `scrm.api.shopmall.weapp.orderRefund.addDelivery`,
...data
})
},
} }
\ No newline at end of file \ No newline at end of file
...@@ -54,7 +54,7 @@ class Request { ...@@ -54,7 +54,7 @@ class Request {
} : { } : {
'Cache-Control': 'no-cache' 'Cache-Control': 'no-cache'
} }
header.merchantId = defaultMerchantId header.merchantId = wx.$merchant_id || defaultMerchantId
let projectName = this.getRopProject(params.method) let projectName = this.getRopProject(params.method)
if (!projectName) projectName = this.getRopProject(params.method) if (!projectName) projectName = this.getRopProject(params.method)
const path = pathEnum[projectName] const path = pathEnum[projectName]
...@@ -81,8 +81,18 @@ class Request { ...@@ -81,8 +81,18 @@ class Request {
} }
if (code == 20 || code == 21) { if (code == 20 || code == 21) {
wx.hideLoading() wx.hideLoading()
return wx.reLaunch({ const thisPage = wx.p.router.getPageInstance(),
url: '/pages/loading/loading' options = Object.keys(thisPage.options)
let currentRoute = thisPage.route,
query = []
if (options.length) {
options.map(key => {
query.push(`${key}=${options[key]}`)
})
}
if (query.length) currentRoute += `?${query.join('&')}`
return wx.p.router.redirectTo('/pages/loading/loading', {
url: `/${currentRoute}`
}) })
} else { } else {
if (code == '0') { if (code == '0') {
......
...@@ -6,12 +6,14 @@ Page({ ...@@ -6,12 +6,14 @@ Page({
data: { data: {
isOpen: false, isOpen: false,
openingStatus: false, openingStatus: false,
IMGURKBASE:'equity/version/1_0_0/', IMGURKBASE: 'equity/version/1_0_0/',
}, },
// 获取门店会员卡信息 // 获取门店会员卡信息
getMemberCardData() { getMemberCardData() {
const {merchantId} = wx.p.storage.get('merchant_info') const {
merchantId
} = wx.p.storage.get('merchant_info')
let newMerchantId = merchantId || defaultMerchantId let newMerchantId = merchantId || defaultMerchantId
let para = { let para = {
merchantId: newMerchantId merchantId: newMerchantId
...@@ -56,27 +58,24 @@ Page({ ...@@ -56,27 +58,24 @@ Page({
}, },
// 去购买会员 // 去购买会员
async openMemberFn() { async openMemberFn() {
let sid = wx.$util.getSessionId() const loginStatu = await wx.p.router.intercept()
if (!sid) { if (loginStatu) return
this.setData({ const {
showLogin: true memberInfo
}) } = this.data
return wx.p.wxApi.showLoading()
}
const { memberInfo } = this.data
wx.$api.showLoading()
let para = { let para = {
equityClassId: memberInfo.equityClassId, equityClassId: memberInfo.equityClassId,
orderCode: memberInfo.orderCode, orderCode: memberInfo.orderCode,
orderSource: 3 orderSource: 3
} }
wx.$Track.setTrack( // wx.$Track.setTrack(
{ // {
...para, // ...para,
type: '购买权益卡' // type: '购买权益卡'
}, // },
7 // 7
) // )
wx.p.api.equityApi.buyMemberCard(para).then(res => { wx.p.api.equityApi.buyMemberCard(para).then(res => {
wx.hideLoading() wx.hideLoading()
this.handlePay(res) this.handlePay(res)
...@@ -84,7 +83,13 @@ Page({ ...@@ -84,7 +83,13 @@ Page({
}, },
// 处理购买参数拉起支付 // 处理购买参数拉起支付
handlePay(payData) { handlePay(payData) {
const { timeStamp, nonceStr, packages, signType, paySign } = payData const {
timeStamp,
nonceStr,
packages,
signType,
paySign
} = payData
let self = this let self = this
wx.requestPayment({ wx.requestPayment({
timeStamp: timeStamp, timeStamp: timeStamp,
......
...@@ -35,4 +35,3 @@ ...@@ -35,4 +35,3 @@
</view> </view>
</view> </view>
</view> </view>
\ No newline at end of file \ No newline at end of file
<login show="{{showLogin}}"></login>
\ No newline at end of file \ No newline at end of file
...@@ -46,8 +46,7 @@ Page({ ...@@ -46,8 +46,7 @@ Page({
encoding: 'base64', //编码格式 encoding: 'base64', //编码格式
success(_res) { success(_res) {
wx.p.wxApi.showLoading('上传中...') wx.p.wxApi.showLoading('上传中...')
wx.p.api.common wx.p.api.commonApi.uploadImg({
.uploadImg({
file: `${type}@${_res.data}` file: `${type}@${_res.data}`
}) })
.then(img => { .then(img => {
......
...@@ -235,7 +235,8 @@ Page({ ...@@ -235,7 +235,8 @@ Page({
}) })
}, },
async join(e) { async join(e) {
wx.p.router.intercept() const loginStatu = await wx.p.router.intercept()
if(loginStatu) return
let params = e && e.detail let params = e && e.detail
if (!params) { if (!params) {
params = { params = {
...@@ -446,7 +447,9 @@ Page({ ...@@ -446,7 +447,9 @@ Page({
}) })
}) })
}, },
getUserAddressList() { async getUserAddressList() {
const res = await wx.p.router.intercept(false)
if (res) return
wx.p.api.mineApi.getUserAddressList().then(data => { wx.p.api.mineApi.getUserAddressList().then(data => {
if (!data.length) { if (!data.length) {
this.setData({ this.setData({
......
...@@ -138,7 +138,7 @@ Page({ ...@@ -138,7 +138,7 @@ Page({
sum: sum, sum: sum,
expressFee, expressFee,
goodsNumber, goodsNumber,
money money: money < 0 ? 0 : money
}) })
}, },
//获取最大优惠券 //获取最大优惠券
...@@ -363,11 +363,11 @@ Page({ ...@@ -363,11 +363,11 @@ Page({
payParams payParams
}) => { }) => {
wx.hideLoading() wx.hideLoading()
wx.$Track.setTrack({ // wx.$Track.setTrack({
goodsList // goodsList
}, // },
7 // 7
) // )
if (needPay) { if (needPay) {
let params = { let params = {
nonceStr: payParams.nonceStr, nonceStr: payParams.nonceStr,
......
...@@ -171,12 +171,12 @@ Page({ ...@@ -171,12 +171,12 @@ Page({
} }
wx.p.api.shopmallApi.delShoppingcart(para).then(res => { wx.p.api.shopmallApi.delShoppingcart(para).then(res => {
wx.p.wxApi.showToast('删除成功') wx.p.wxApi.showToast('删除成功')
wx.$Track.setTrack({ // wx.$Track.setTrack({
id, // id,
type: '购物车移除商品' // type: '购物车移除商品'
}, // },
7 // 7
) // )
setTimeout(() => { setTimeout(() => {
this.getShoppingcartList() this.getShoppingcartList()
}, 1.5 * 1000) }, 1.5 * 1000)
......
...@@ -164,6 +164,15 @@ ...@@ -164,6 +164,15 @@
background: var(--btnColor); background: var(--btnColor);
border-radius: var(--borderRadius); border-radius: var(--borderRadius);
font-weight: 500; font-weight: 500;
padding: 0 !important;
margin: 0 !important;
font-size: 28rpx;
&[disabled]:not([type]) {
background: #CCCED1 !important;
border-color: #CCCED1 !important;
color: #fff !important;
box-shadow: none;
}
} }
.goods-action .total { .goods-action .total {
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<text class="unit">¥</text>{{sum||0}} <text class="unit">¥</text>{{sum||0}}
</view> </view>
</view> </view>
<view class="btn text-center" bindtap="checkOut">结算({{count||0}})</view> <button class="btn text-center" bindtap="checkOut" disabled="{{count<1}}">结算({{count||0}})</button>
</view> </view>
</goods-action> </goods-action>
</block> </block>
\ No newline at end of file \ No newline at end of file
...@@ -16,6 +16,7 @@ Page({ ...@@ -16,6 +16,7 @@ Page({
} }
}, },
onLoad: function (options) { onLoad: function (options) {
console.log(options,'==========')
if (options.id) { if (options.id) {
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: '编辑收货地址' title: '编辑收货地址'
...@@ -49,10 +50,6 @@ Page({ ...@@ -49,10 +50,6 @@ Page({
'userObj.areaId': ad_info.adcode 'userObj.areaId': ad_info.adcode
}) })
}, },
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) { },
/**获取当前位置 */ /**获取当前位置 */
getLocation() { getLocation() {
let { currentAddress } = this.data let { currentAddress } = this.data
......
...@@ -18,7 +18,9 @@ Page({ ...@@ -18,7 +18,9 @@ Page({
let url = '/packageMine/pages/order/detail/detail' let url = '/packageMine/pages/order/detail/detail'
// if (orderStatus > 5 && orderStatus != 14 && orderStatus != 13&&orderStatus != 15) url = 'afterSaleDetail' // if (orderStatus > 5 && orderStatus != 14 && orderStatus != 13&&orderStatus != 15) url = 'afterSaleDetail'
wx.p.router.go(url, item) wx.p.router.go(url, {
orderCode: item
})
// wx.navigateTo({ // wx.navigateTo({
// url: '/packageMine/pages/order/detail/detail?orderCode=S2112081509592138' // url: '/packageMine/pages/order/detail/detail?orderCode=S2112081509592138'
// }) // })
......
...@@ -51,9 +51,7 @@ Page({ ...@@ -51,9 +51,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
wx.p.router.getData(orderCode => { this.getOrderRefundDetail(options.orderCode)
this.getOrderRefundDetail(orderCode)
})
}, },
getOrderRefundDetail(orderCode) { getOrderRefundDetail(orderCode) {
wx.p.wxApi.showLoading('加载中...') wx.p.wxApi.showLoading('加载中...')
......
...@@ -81,8 +81,7 @@ Page({ ...@@ -81,8 +81,7 @@ Page({
encoding: 'base64', //编码格式 encoding: 'base64', //编码格式
success(_res) { success(_res) {
wx.p.wxApi.showLoading('上传中...') wx.p.wxApi.showLoading('上传中...')
commonApi wx.p.api.commonApi.uploadImg({
.uploadImg({
file: `${type}@${_res.data}` file: `${type}@${_res.data}`
}) })
.then(img => { .then(img => {
...@@ -113,7 +112,7 @@ Page({ ...@@ -113,7 +112,7 @@ Page({
wx.p.wxApi.showToast('申请成功!') wx.p.wxApi.showToast('申请成功!')
setTimeout(() => { setTimeout(() => {
wx.p.router.back(prevPage => { wx.p.router.back(prevPage => {
prevPage.clearData() prevPage.clearData && prevPage.clearData()
}, 2) }, 2)
}, 1.5 * 1000) }, 1.5 * 1000)
} else { } else {
......
{ {
"navigationBarTitleText": "申请售后" "navigationBarTitleText": "申请售后",
"usingComponents": {
"gl-textarea": "/components/GlTextarea/GlTextarea"
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<block wx:if="{{imgUrls.length < 1}}"> <block wx:if="{{imgUrls.length < 1}}">
<view class="one text-center" bindtap="upLoad"> <view class="one text-center" bindtap="upLoad">
<view class="icon"> <view class="icon">
<image webp src="{{IMGURL}}mine/camera.png?v={{img_version}}"></image> <glsx-image webp src="mine/camera.png"></glsx-image>
</view> </view>
</view> </view>
</block> </block>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<image webp src="{{item}}"></image> <image webp src="{{item}}"></image>
<view class="del text-center" catchtap="del" data-index="{{index}}"> <view class="del text-center" catchtap="del" data-index="{{index}}">
<view class="icon"> <view class="icon">
<image webp src="{{IMGURL}}mine/del.png?v={{img_version}}"></image> <glsx-image webp src="mine/del.png"></glsx-image>
</view> </view>
</view> </view>
</view> </view>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<block wx:if="{{imgUrls.length < 5}}"> <block wx:if="{{imgUrls.length < 5}}">
<view class="upload-item item text-center" bindtap="upLoad"> <view class="upload-item item text-center" bindtap="upLoad">
<view class="icon"> <view class="icon">
<image webp src="{{IMGURL}}mine/camera.png?v={{img_version}}"></image> <glsx-image webp src="mine/camera.png"></glsx-image>
</view> </view>
</view> </view>
</block> </block>
......
import QR from '~/utils/lib/wxqrcode' import { wxqrcode as QR } from "~/lib/index";
import { import { orderMixin } from "~/mixins/index";
orderMixin import { iosTimeFormat } from "~/utils/format";
} from '~/mixins/index'
import {
iosTimeFormat,
} from '~/utils/format'
Page({ Page({
behaviors: [orderMixin], behaviors: [orderMixin],
/** /**
...@@ -12,124 +8,126 @@ Page({ ...@@ -12,124 +8,126 @@ Page({
*/ */
data: { data: {
couponsList: [], couponsList: [],
orderObj: [{ orderObj: [
label: '下单日期', {
key: 'time' label: "下单日期",
key: "time",
}, },
{ {
label: '订单编号', label: "订单编号",
key: 'orderCode' key: "orderCode",
}, },
{ {
label: '收货地址', label: "收货地址",
key: 'shipAddress', key: "shipAddress",
alignItems: 'flex-start' alignItems: "flex-start",
}, },
{ {
label: '订单状态', label: "订单状态",
key: 'orderStatus', key: "orderStatus",
enum: true enum: true,
} },
], ],
deliveryStatus: { deliveryStatus: {
1: '待发货', 1: "待发货",
2: '已发货', 2: "已发货",
3: '已收货' 3: "已收货",
}
}, },
onRoute(orderCode) {
if (Object.keys(orderCode).length !== 0) {
console.log(orderCode)
this.getOrderDetail(orderCode)
}
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(options,'=======')
if (options && options.orderCode) { if (options && options.orderCode) {
let orderCode = options.orderCode let orderCode = options.orderCode;
this.getOrderDetail(orderCode) this.getOrderDetail(orderCode);
} }
}, },
getOrderDetail(orderCode) { getOrderDetail(orderCode) {
let { let { orderObj } = this.data;
orderObj wx.p.wxApi.showLoading("加载中...");
} = this.data wx.p.api.shopmallApi.getOrderDetail(orderCode).then((data) => {
wx.p.wxApi.showLoading('加载中...') wx.hideLoading();
wx.p.api.shopmallApi.getOrderDetail(orderCode).then(data => { console.log(data);
wx.hideLoading() data.time = new Date(iosTimeFormat(data.createdDate)).format(
console.log(data) "yyyy.MM.dd hh:mm:ss"
data.time = new Date(iosTimeFormat(data.createdDate)).format('yyyy.MM.dd hh:mm:ss') );
data.orderGoods.map(e => { data.orderGoods.map((e) => {
e.retailPrice = Number(e.retailPrice).toFixed(2) e.retailPrice = Number(e.retailPrice).toFixed(2);
if (e.activityPrice) e.activityPrice = Number(e.activityPrice).toFixed(2) if (e.activityPrice)
}) e.activityPrice = Number(e.activityPrice).toFixed(2);
data.orderPrice = Number(data.orderPrice).toFixed(2) });
data.expressFee = Number(data.expressFee).toFixed(2) data.orderPrice = Number(data.orderPrice).toFixed(2);
data.payPrice = Number(data.payPrice).toFixed(2) data.expressFee = Number(data.expressFee).toFixed(2);
data.payPrice = Number(data.payPrice).toFixed(2);
if (data.orderSource == 4) { if (data.orderSource == 4) {
orderObj[2] = { orderObj[2] = {
label: '商户订单号', label: "商户订单号",
key: 'outTradeNo', key: "outTradeNo",
} };
} }
this.setData({ this.setData({
orderInfo: data, orderInfo: data,
orderObj orderObj,
}) });
if (data.deliveryType == 1 && data.orderVerification) this.setQr(data.orderVerification.verificationCode) if (data.deliveryType == 1 && data.orderVerification)
this.setQr(data.orderVerification.verificationCode);
if (data.relatedUserCoupon) { if (data.relatedUserCoupon) {
let list = data.relatedUserCoupon.map(item => { let list = data.relatedUserCoupon.map((item) => {
item.receiveStartTime = new Date(iosTimeFormat(item.receiveStartTime)).format('yyyy.MM.dd') item.receiveStartTime = new Date(
iosTimeFormat(item.receiveStartTime)
).format("yyyy.MM.dd");
if (item.effectiveType == 1) { if (item.effectiveType == 1) {
item.receiveEndTime = new Date(iosTimeFormat(item.receiveEndTime)).format('yyyy.MM.dd hh:mm:ss') item.receiveEndTime = new Date(
iosTimeFormat(item.receiveEndTime)
).format("yyyy.MM.dd hh:mm:ss");
} else { } else {
item.receiveEndTime = new Date(iosTimeFormat(item.receiveEndTime)).format('yyyy.MM.dd') item.receiveEndTime = new Date(
iosTimeFormat(item.receiveEndTime)
).format("yyyy.MM.dd");
} }
return item return item;
}) });
this.setData({ this.setData({
couponsList: list couponsList: list,
}) });
} }
}) });
}, },
toDetail() { toDetail() {
let [temp] = this.data.orderInfo.relatedUserCoupon, { let [temp] = this.data.orderInfo.relatedUserCoupon,
discountType, { discountType, useChannel, id } = temp,
useChannel, detailInfo = {
id xx: "xx",
} = temp, detailInfo = { };
xx: 'xx'
}
if (discountType == 2 || discountType == 4) { if (discountType == 2 || discountType == 4) {
wx.p.router.go('/packageMall/pages/coupon/coupon', { wx.p.router.go("/packageMall/pages/coupon/coupon", {
userCouponId: id, userCouponId: id,
useMemberType: this.data.useMemberType, useMemberType: this.data.useMemberType,
detailInfo detailInfo,
}) });
return return;
} }
/**线上商品代金券 */ /**线上商品代金券 */
if (discountType == 3 && useChannel == 1) { if (discountType == 3 && useChannel == 1) {
if (this.data.useMemberType == 1) { if (this.data.useMemberType == 1) {
wx.p.wxApi.showToast('代金券已使用') wx.p.wxApi.showToast("代金券已使用");
return return;
} }
wx.p.router.go('/packageMine/pages/coupon/recommend/recommend', { wx.p.router.go("/packageMine/pages/coupon/recommend/recommend", {
couponInfo: temp couponInfo: temp,
}) });
return return;
} }
wx.p.router.go('/packageMine/pages/coupon/detail/detail', { wx.p.router.go("/packageMine/pages/coupon/detail/detail", {
item: temp item: temp,
}) });
}, },
setQr(data) { setQr(data) {
this.setData({ this.setData({
qr: QR.createQrCodeImg(`t=1&c=${data}`) qr: QR.createQrCodeImg(`t=1&c=${data}`),
}) });
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
...@@ -159,5 +157,5 @@ Page({ ...@@ -159,5 +157,5 @@ Page({
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () {}
})
\ No newline at end of file \ No newline at end of file
onReachBottom: function () {},
});
...@@ -161,6 +161,7 @@ Page({ ...@@ -161,6 +161,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(options,'=========')
this.setData({ this.setData({
hasUserInfo: true, hasUserInfo: true,
tabIndex: options.tabIndex, tabIndex: options.tabIndex,
...@@ -451,100 +452,5 @@ Page({ ...@@ -451,100 +452,5 @@ Page({
orderCode, orderCode,
type: 2, type: 2,
}) })
},
/**平台商城跳转 */
async jumpPlatformShop(e) {
let {
item,
url
} = e.currentTarget.dataset
if (item.afterSaleStatus && url == 'afterSaleDetail/index' && item.afterSaleStatus == 8) url = 'applySale/index'
if (url == 'applySale/index') {
const res = await this.getReturnCount(item)
if (!res.applyQty) return wx.p.wxApi.showToast('该商品不支持售后')
item.applyQty = res.applyQty
} }
wx.p.router.go(`/packageMall/pages/platformShop/${url}`, item)
},
/**平台商城取消订单*/
cancelPlatformOrder(e) {
wx.showModal({
title: '温馨提示',
content: '请问您是否要取消付款',
confirmText: '确定',
cancelText: '取消',
confirmColor: '#F13C3D',
}).then(async res => {
if (res.confirm) {
wx.p.wxApi.showLoading()
try {
const {
orderCode
} = e.currentTarget.dataset, {
code,
message
} = await wx.p.api.shopmallApi.cancelPlatformOrder({
subOrderCode: orderCode
})
wx.hideLoading()
if (code == 0) {
wx.p.wxApi.showToast('取消成功')
setTimeout(() => {
this.getOrderList()
}, 1.5e3)
} else throw message
} catch (error) {
wx.p.wxApi.showToast(error)
}
}
})
},
/**平台商城支付 */
toPayOrder(e) {
wx.p.wxApi.showLoading()
const {
orderCode
} = e.currentTarget.dataset
wx.p.api.shopmallApi.platformGoodsPayOrder({
orderCode,
paymentSource: 1
}).then(res => {
wx.hideLoading()
if (res) {
const {
timeStamp,
nonceStr,
packages,
signType,
paySign
} = res.payParams
wx.requestPayment({
timeStamp: timeStamp,
nonceStr: nonceStr,
package: packages,
signType: signType,
paySign: paySign,
success() {
wx.p.router.go('/packageMine/pages/order/complete/complete', {
success: true
})
},
fail(res) {
if (res.errMsg == 'requestPayment:fail cancel') {
wx.p.wxApi.showToast('取消支付')
}
}
})
}
})
},
/**获取可申请的售后数量 */
getReturnCount(orderInfo) {
const PARAMS = {
subOrderCode: orderInfo.orderCode,
goodsSkuCode: orderInfo.orderGoods[0].goodsSkuCode
}
return wx.p.api.shopmallApi.platformApplyCount(PARAMS)
},
}) })
\ No newline at end of file \ No newline at end of file
...@@ -9,6 +9,7 @@ Page({ ...@@ -9,6 +9,7 @@ Page({
code, code,
message message
}) => { }) => {
wx.p.wxApi.showLoading()
if (code == '0') { if (code == '0') {
// wx.$Track.setTrack({}, 4) // wx.$Track.setTrack({}, 4)
wx.$authStatus = true wx.$authStatus = true
...@@ -19,14 +20,18 @@ Page({ ...@@ -19,14 +20,18 @@ Page({
prevPage.setData({ prevPage.setData({
userInfo: null, userInfo: null,
isMember: false, isMember: false,
vipInfo: null,
orderNumberList: null
}) })
}) })
} else { } else {
if (code == '21' || code == '20') { if (code == '21' || code == '20') {
try { try {
const res = await wx.p.api.userApi.login() const res = await wx.p.api.userApi.login()
if(res.code == 0) this.logout() if (res.code == 0) {
else throw res.message wx.p.storage.set('sessionId', res.data.sessionId)
this.logout()
} else throw res.message
} catch (error) { } catch (error) {
wx.p.wxApi.showToast(error) wx.p.wxApi.showToast(error)
} }
......
...@@ -35,8 +35,14 @@ Page({ ...@@ -35,8 +35,14 @@ Page({
async onLoad() { async onLoad() {
wx.p.wxApi.showLoading() wx.p.wxApi.showLoading()
const { const {
data data,
code
} = await wx.p.api.userApi.login() } = await wx.p.api.userApi.login()
if (code == '0') {
wx.p.storage.set('userInfo', data)
wx.p.storage.set('sessionId', data.sessionId)
wx.p.router.back()
}
if (data) this.sessionId = data.sessionId if (data) this.sessionId = data.sessionId
wx.hideLoading() wx.hideLoading()
}, },
...@@ -159,7 +165,7 @@ Page({ ...@@ -159,7 +165,7 @@ Page({
wx.p.storage.set('sessionId', data.sessionId) wx.p.storage.set('sessionId', data.sessionId)
// 返回上一页 // 返回上一页
wx.p.router.back(thisPage => { wx.p.router.back(thisPage => {
thisPage.setData({ thisPage && thisPage.setData({
userInfo: data userInfo: data
}) })
}) })
......
<view class="layout"> <view class="layout">
<view class="login-bg x-center">
<glsx-image src="login/login-bg.png"></glsx-image>
</view>
<navigation-bar navStyle="background:transparent;" custom page-title="登录"> <navigation-bar navStyle="background:transparent;" custom page-title="登录">
<view class="nav-bar flex"> <view class="nav-bar flex">
<view class="back flex" bindtap="back"> <view class="back flex" bindtap="back">
......
/* pages/login/login.wxss */ /* pages/login/login.wxss */
page { page {}
background-color: #000 !important;
.login-bg {
position: fixed;
z-index: -2;
width: 1350rpx;
height: 1664rpx;
top: -60rpx;
}
.layout::before{
position: fixed;
left: 0;
top: 0;
width: 100vw;
height: 600rpx;
background-image: linear-gradient(0deg, #0a030300 22%, #0A0303 100%);
z-index: -1;
content: '';
}
.layout::after {
position: fixed;
left: 0;
bottom: 0;
width: 100vw;
height: 400rpx;
transform: scaleY(-1);
background-image: linear-gradient(0deg, #0a030300 22%, #0A0303 90%);
z-index: -1;
content: '';
} }
.nav-bar { .nav-bar {
...@@ -78,7 +107,6 @@ page { ...@@ -78,7 +107,6 @@ page {
border-color: #CCCED1 !important; border-color: #CCCED1 !important;
color: #fff !important; color: #fff !important;
box-shadow: none; box-shadow: none;
} }
.wx-auth-button[disabled]:not([type])::after { .wx-auth-button[disabled]:not([type])::after {
......
...@@ -12,8 +12,19 @@ Page({ ...@@ -12,8 +12,19 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
async onLoad(options) { async onLoad(options) {
console.log(options, '===')
this.tabList = __wxConfig.tabBar.list this.tabList = __wxConfig.tabBar.list
wx.p.wxApi.showLoading() wx.p.wxApi.showLoading()
//scenc获取页面参数并跳转
if (options.scene) {
return this.getSceneById(options.scene)
}
if (options.url) {
return this.login(options)
}
},
async login(options) {
if (options.merchantId) wx.$merchant_id = options.merchantId
try { try {
const { const {
code, code,
...@@ -34,10 +45,6 @@ Page({ ...@@ -34,10 +45,6 @@ Page({
wx.p.storage.rm('sessionId') wx.p.storage.rm('sessionId')
} }
console.log(data, '=============') console.log(data, '=============')
//scenc获取页面参数并跳转
if (options.scene) {
return this.getSceneById(options.scene)
}
if (options.url) { if (options.url) {
return this.jumpPage(options.url) return this.jumpPage(options.url)
} }
...@@ -46,8 +53,8 @@ Page({ ...@@ -46,8 +53,8 @@ Page({
} catch (error) { } catch (error) {
console.log(error) console.log(error)
wx.p.wxApi.showToast(String(error)) wx.p.wxApi.showToast(String(error))
wx.p.router.goHome()
} }
}, },
async getSceneById(scene) { async getSceneById(scene) {
const id = decodeURIComponent(scene).split('=').at(-1) const id = decodeURIComponent(scene).split('=').at(-1)
...@@ -58,7 +65,7 @@ Page({ ...@@ -58,7 +65,7 @@ Page({
} = await wx.p.api.wechatApi.getSceneById({ } = await wx.p.api.wechatApi.getSceneById({
id id
}) })
if (code == 0) this.jumpPage(data.scene) if (code == 0) this.login(data.scene)
else throw {} else throw {}
} catch (error) { } catch (error) {
wx.p.wxApi.showToast(error || '获取scene失败') wx.p.wxApi.showToast(error || '获取scene失败')
......
{ {
"usingComponents": {} "usingComponents": {},
"navigationStyle": "custom"
} }
\ No newline at end of file \ No newline at end of file
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<image webp src="{{item.activityImg}}" lazy-load></image> <image webp src="{{item.activityImg}}" lazy-load></image>
</view> </view>
<view class="item-box-content"> <view class="item-box-content">
<view class='item-box-title'><text>{{item.activityName}}</text></view> <view class='item-box-title'><text class="item-box-title-text">{{item.activityName}}</text></view>
<view class='item-box-time'> <view class='item-box-time'>
<view class="text text-hide">{{item.viewAmount||0}}人查看|售出{{item.saleAmount || 0}}</view> <view class="text text-hide">{{item.viewAmount||0}}人查看|售出{{item.saleAmount || 0}}</view>
</view> </view>
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
</view> </view>
<view class="item-box-bubble"> <view class="item-box-bubble">
<!-- 活动 --> <!-- 活动 -->
<view> <view class="item-box-bubble-view">
<text class="activity-text">秒杀价</text> <text class="activity-text">秒杀价</text>
<view class="time-box"> <view class="time-box">
<view class="time {{item.activityStatus == 1 ? 'start' : 'end'}} " wx:if="{{item.activityStatus != 3}}"> <view class="time {{item.activityStatus == 1 ? 'start' : 'end'}} " wx:if="{{item.activityStatus != 3}}">
......
...@@ -53,14 +53,14 @@ ...@@ -53,14 +53,14 @@
color: #0A0D14; color: #0A0D14;
} }
.item-box-title image { .item-box-title .item-box-title-image {
flex: 0 0 48rpx; flex: 0 0 48rpx;
height: 32rpx; height: 32rpx;
margin-right: 12rpx; margin-right: 12rpx;
margin-top: 5rpx; margin-top: 5rpx;
} }
.item-box-title text { .item-box-title .item-box-title-text {
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
display: -webkit-box; display: -webkit-box;
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
margin-bottom: -6rpx; margin-bottom: -6rpx;
} }
.item-box-bubble>view { .item-box-bubble>.item-box-bubble-view {
position: relative; position: relative;
background: #FFF5F3; background: #FFF5F3;
height: 40rpx; height: 40rpx;
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
display: flex; display: flex;
} }
.item-box-bubble>view::after { .item-box-bubble>.item-box-bubble-view::after {
content: ''; content: '';
position: absolute; position: absolute;
width: 0; width: 0;
......
...@@ -3,17 +3,17 @@ ...@@ -3,17 +3,17 @@
<view class="bgkf"> <view class="bgkf">
<glsx-image webp src="home/home-kf-bg.png"></glsx-image> <glsx-image webp src="home/home-kf-bg.png"></glsx-image>
<view class="close-icon" bindtap="showFlex"> <view class="close-icon" bindtap="showFlex">
<glsx-image webp src="home/kf-close.png"></glsx-image> <glsx-image class="image-close"webp src="home/kf-close.png"></glsx-image>
</view> </view>
<view class="qr-box"> <view class="qr-box">
<view class="userinfo-wrap"> <view class="userinfo-wrap">
<view class="icon"> <view class="icon">
<image wx:if="{{customerlist[0].thumbAvatar}}" webp src="{{customerlist[0].thumbAvatar}}"></image> <image class="image-icon" wx:if="{{customerlist[0].thumbAvatar}}" webp src="{{customerlist[0].thumbAvatar}}"></image>
<glsx-image wx:else webp src="home/kf-persion-icon.png"></glsx-image> <glsx-image class="image-icon" wx:else webp src="home/kf-persion-icon.png"></glsx-image>
</view> </view>
<view class="name">{{customerlist[0].staffName || ''}}</view> <view class="name">{{customerlist[0].staffName || ''}}</view>
<view class="mobile" wx:if="{{customerlist[0].staffPhone}}"> <view class="mobile" wx:if="{{customerlist[0].staffPhone}}">
<glsx-image webp src="home/kf-mobile.png"></glsx-image> <glsx-image class="image-mobile" webp src="home/kf-mobile.png"></glsx-image>
<text>{{customerlist[0].staffPhone}}</text> <text>{{customerlist[0].staffPhone}}</text>
</view> </view>
<view class="qr-icon"> <view class="qr-icon">
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
</view> </view>
</view> </view>
<view class="kf-text"> <view class="kf-text">
<view class="text-left"><glsx-image webp src="home/home-Kf-down.png"></glsx-image><text>保存图片\n到相册</text></view> <view class="text-left kf-text-view" ><glsx-image class="kf-image" webp src="home/home-Kf-down.png"></glsx-image><text>保存图片\n到相册</text></view>
<view><glsx-image webp src="home/home-Kf-phone.png"></glsx-image><text>打开微信扫一扫添加客服企微</text></view> <view class="kf-text-view"><glsx-image webp class="kf-image" src="home/home-Kf-phone.png"></glsx-image><text>打开微信扫一扫添加客服企微</text></view>
</view> </view>
<view class="save-btn"> <view class="save-btn">
<view class="btn text-center" bindtap="saveClick"> <view class="btn text-center" bindtap="saveClick">
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
right: 16rpx; right: 16rpx;
top: -68rpx; top: -68rpx;
} }
.close-icon image{ .close-icon .image-close{
width:48rpx; width:48rpx;
height:48rpx; height:48rpx;
} }
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
top: -28rpx; top: -28rpx;
} }
.model .bgkf .icon image { .model .bgkf .icon .image-icon {
border-radius: 50%; border-radius: 50%;
} }
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.qr-box .mobile image{ .qr-box .mobile .image-mobile{
width: 24rpx; width: 24rpx;
height: 26rpx; height: 26rpx;
} }
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
padding: 0 40rpx; padding: 0 40rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.kf-text view{ .kf-text .kf-text-view{
flex: 1; flex: 1;
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
margin-left: 20rpx; margin-left: 20rpx;
color: #B1B1B3; color: #B1B1B3;
} }
.kf-text image{ .kf-text .kf-image{
flex-shrink: 0; flex-shrink: 0;
width: 60rpx; width: 60rpx;
height: 60rpx; height: 60rpx;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<view class="tab {{index==count?'active':''}}" bindtap="click" data-count="{{index}}" id="to-{{index}}"> <view class="tab {{index==count?'active':''}}" bindtap="click" data-count="{{index}}" id="to-{{index}}">
<view class="text">{{item}}</view> <view class="text">{{item}}</view>
<view class="line"> <view class="line">
<glsx-image src="home/tab-line.png"></glsx-image> <glsx-image class="line-image" src="home/tab-line.png"></glsx-image>
</view> </view>
</view> </view>
</block> </block>
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
transition: all .25s; transition: all .25s;
} }
.tab .line image { .tab .line .line-image {
width: 40rpx; width: 40rpx;
height: 16rpx; height: 16rpx;
} }
......
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
</view> </view>
<view class="item-box-content"> <view class="item-box-content">
<view class='item-box-title'> <view class='item-box-title'>
<image wx:if="{{item.goods.isMemberGoods}}" webp src="{{item.IMGURL}}index/member-goods-icon.png" /> <image class="item-box-title-image" wx:if="{{item.goods.isMemberGoods}}" webp src="{{item.IMGURL}}index/member-goods-icon.png" />
<text>{{item.goods.goodsName}}</text> <text class="item-box-title-text">{{item.goods.goodsName}}</text>
</view> </view>
<view class='item-box-time'> <view class='item-box-time'>
<view class="text text-hide"> <view class="text text-hide">
...@@ -45,8 +45,8 @@ ...@@ -45,8 +45,8 @@
</view> </view>
<view class="item-box-bubble"> <view class="item-box-bubble">
<!-- 会员商品 --> <!-- 会员商品 -->
<view wx:if="{{item.goods.isMemberGoods}}" class="text"> <view wx:if="{{item.goods.isMemberGoods}}" class="text item-box-bubble-view">
<text>会员价</text> <text class="item-box-bubble-text">会员价</text>
开通会员权益立享 开通会员权益立享
</view> </view>
</view> </view>
......
...@@ -49,14 +49,14 @@ ...@@ -49,14 +49,14 @@
color: #0A0D14; color: #0A0D14;
} }
.item-box-title image{ .item-box-title .item-box-title-image{
flex: 0 0 48rpx; flex: 0 0 48rpx;
height: 32rpx; height: 32rpx;
margin-right: 12rpx; margin-right: 12rpx;
margin-top: 5rpx; margin-top: 5rpx;
} }
.item-box-title text{ .item-box-title .item-box-title-text{
font-size: 28rpx; font-size: 28rpx;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
margin-bottom: -10rpx; margin-bottom: -10rpx;
} }
.item-box-bubble view{ .item-box-bubble .item-box-bubble-view{
position: relative; position: relative;
background: #FFF5F3; background: #FFF5F3;
height: 40rpx; height: 40rpx;
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
font-size: 20rpx; font-size: 20rpx;
color: #FF6038; color: #FF6038;
} }
.item-box-bubble view::after { .item-box-bubble .item-box-bubble-view::after {
content: ''; content: '';
position: absolute; position: absolute;
width: 0; width: 0;
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
border-bottom: 16rpx solid #FFF5F3; border-bottom: 16rpx solid #FFF5F3;
} }
.item-box-bubble text{ .item-box-bubble .item-box-bubble-text{
margin-right: 16rpx; margin-right: 16rpx;
} }
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<glsx-image class="equity-icon" src="home/vip-icon.png"></glsx-image> <glsx-image class="equity-icon" src="home/vip-icon.png"></glsx-image>
<text class="text">生活权益|专享超百种生活权益</text> <text class="text">生活权益|专享超百种生活权益</text>
<block wx:if="{{!memberInfo.equityName}}"> <block wx:if="{{!memberInfo.equityName}}">
<view class="equity-btn" bindtap="toBuyMember">立即开通</view> <view class="content-view equity-btn" bindtap="toBuyMember">立即开通</view>
</block> </block>
</view> </view>
</view> </view>
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
align-items: center; align-items: center;
} }
.equity-box .content view { .equity-box .content .content-view {
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -38,7 +38,6 @@ page { ...@@ -38,7 +38,6 @@ page {
.layout { .layout {
padding-bottom: 200rpx;
position: relative; position: relative;
padding-top: 16rpx; padding-top: 16rpx;
background: transparent; background: transparent;
......
<navigation-bar page-title="首页" custom bindnavbarReady="navbarReady" navStyle="background-color: transparent;"> <navigation-bar page-title="首页" custom bindnavbarReady="navbarReady" navStyle="background-color: #F9F7F7;">
<view class="home-top flex"> <view class="home-top flex">
海马刀 海马刀
<view class="widget-box" bindtap="openKF"> <view class="widget-box" bindtap="openKF">
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<view class="btn text-center" bindtap="jump" data-url="activity.index"> <view class="btn text-center" bindtap="jump" data-url="activity.index">
查看更多 查看更多
<view class="icon"> <view class="icon">
<image webp src="{{IMGURL}}index/more.png"></image> <glsx-image webp src="home/more.png"></glsx-image>
</view> </view>
</view> </view>
</block> </block>
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<block wx:else> <block wx:else>
<view class="nothing flex"> <view class="nothing flex">
<view class="icon"> <view class="icon">
<image webp src="{{IMGURL}}index/index-activity-nothing.png"></image> <glsx-image webp src="home/index-activity-nothing.png"></glsx-image>
</view> </view>
暂无优惠活动,敬请期待 暂无优惠活动,敬请期待
</view> </view>
......
...@@ -22,13 +22,7 @@ Page({ ...@@ -22,13 +22,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
let {
userInfo
} = this.data
if (userInfo) {
this.getOrderNumberList()
this.getMemberCardData() this.getMemberCardData()
}
}, },
navbarReady(e) { navbarReady(e) {
let { let {
...@@ -66,17 +60,25 @@ Page({ ...@@ -66,17 +60,25 @@ Page({
}) })
} else { } else {
wx.p.api.equityApi.checkOpenMember().then(res => { wx.p.api.equityApi.checkOpenMember().then(res => {
let flag = false console.log(res,'----------')
res.data = {
}
let flag = false,
identity = 0 // 普通会员3 银卡2 金卡1 非会员 0
if (res.data && res.data.validitDate) { if (res.data && res.data.validitDate) {
res.data.time = new Date(res.data.validitDate).format('yyyy.MM.dd') res.data.time = new Date(res.data.validitDate).format('yyyy.MM.dd')
} }
if (res.code == 0 && res.data) { if (res.code == 0 && res.data) {
flag = true flag = true
identity = 3
if (res.data && res.data.cardTypeSpecial) identity = res.data.cardTypeSpecial
} }
wx.p.storage.set('isVIP', flag) wx.p.storage.set('isVIP', flag)
this.setData({ this.setData({
isMember: flag, isMember: flag,
vipInfo: res.data vipInfo: res.data,
identity
}) })
}) })
} }
...@@ -86,7 +88,9 @@ Page({ ...@@ -86,7 +88,9 @@ Page({
}, },
// 获取门店会员卡信息 // 获取门店会员卡信息
getMemberCardData() { getMemberCardData() {
const {merchantId} = wx.p.storage.get('merchant_info') const {
merchantId
} = wx.p.storage.get('merchant_info')
let para = { let para = {
merchantId merchantId
} }
...@@ -96,7 +100,7 @@ Page({ ...@@ -96,7 +100,7 @@ Page({
}) })
}) })
}, },
goInterests(){ goInterests() {
wx.p.router.switchTab('/pages/tab/equity/index') wx.p.router.switchTab('/pages/tab/equity/index')
}, },
// 开通会员页面 // 开通会员页面
...@@ -114,7 +118,13 @@ Page({ ...@@ -114,7 +118,13 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
let {
userInfo
} = this.data
if (userInfo && userInfo.phone) {
this.getOrderNumberList()
this.toCheckMember() this.toCheckMember()
}
}, },
/** /**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!