Commit 5bbe555c by 前端

Merge branch 'v1.0.5' of http://192.168.3.233:8090/glsx/gl_tape into v1.0.5

2 parents c6621814 f6bb913d
...@@ -2,7 +2,7 @@ import http from "../request/http"; ...@@ -2,7 +2,7 @@ import http from "../request/http";
module.exports = { module.exports = {
/**获取APP更新 */ /**获取APP更新 */
findSoureList(data) { findSoureList (data) {
return http.post({ return http.post({
method: "dj.api.smartcarlife.recepiton.soure.findSoureList", method: "dj.api.smartcarlife.recepiton.soure.findSoureList",
projectName: "boutique", projectName: "boutique",
...@@ -10,22 +10,22 @@ module.exports = { ...@@ -10,22 +10,22 @@ module.exports = {
}); });
}, },
/** 查询可发放礼券-分页查询商户券列表 */ /** 查询可发放礼券-分页查询商户券列表 */
findCouponList(data) { findCouponList (data) {
return http.post( return http.post(
{ {
method: "dj.api.smartcarlife.merchantCoupon.pageForZYApp", method: "dj.api.smartcarlife.merchantCoupon.pageForZYApp",
projectName: "boutique", projectName: "boutique",
onlyUsable: true, onlyUsable: true,
currentPage: 1,
pageSize: 99999,
...data, ...data,
}, }
false,
"ip"
); );
}, },
/**查询用户是否领券 */ /**查询用户是否领券 */
findCustomerReceivedStatus(data) { findCustomerReceivedStatus (data) {
return http.post({ return http.post({
method: "dj.api.smartcarlife.customerCoupon.page", method: "dj.api.smartcarlife.customerCoupon.pageForZYApp",
projectName: "boutique", projectName: "boutique",
...data, ...data,
currentPage: 1, currentPage: 1,
...@@ -33,7 +33,7 @@ module.exports = { ...@@ -33,7 +33,7 @@ module.exports = {
}); });
}, },
/**历史成交客户 */ /**历史成交客户 */
historyDealOrderPage(data) { historyDealOrderPage (data) {
return http.post({ return http.post({
method: "dj.api.smartcarlife.order.historyDealOrder.page", method: "dj.api.smartcarlife.order.historyDealOrder.page",
projectName: "boutique", projectName: "boutique",
...@@ -41,7 +41,7 @@ module.exports = { ...@@ -41,7 +41,7 @@ module.exports = {
}); });
}, },
/**客户邀约记录 */ /**客户邀约记录 */
customerInviteRecordPage(data) { customerInviteRecordPage (data) {
return http.post({ return http.post({
method: "dj.api.smartcarlife.customerInviteRecord.page", method: "dj.api.smartcarlife.customerInviteRecord.page",
projectName: "boutique", projectName: "boutique",
......
...@@ -68,10 +68,7 @@ class Request { ...@@ -68,10 +68,7 @@ class Request {
let { let {
data, data,
} = response } = response
if (!data) return uni.showToast({ if (!data) return reject()
title: "接口异常",
icon: "none",
});
let { code, message } = data let { code, message } = data
if (returnAll) { if (returnAll) {
resolve(data); resolve(data);
......
.sprite-icon { .sprite-icon { background-image: url(@/assets/images/sprite.png);background-size: 1070rpx 876rpx;}
background-image: url(@/assets/images/sprite.png); .icon-aito { width: 320rpx; height: 36rpx; background-position: 0rpx -734rpx;}
background-size: 1070rpx 876rpx; .icon-arrow-right { width: 32rpx; height: 32rpx; background-position: -1032rpx -60rpx;}
} .icon-back { width: 128rpx; height: 50rpx; background-position: -942rpx 0rpx;}
.icon-arrow-right { .icon-change-account { width: 32rpx; height: 32rpx; background-position: -1032rpx -102rpx;}
width: 32rpx; .icon-customer-1 { width: 400rpx; height: 400rpx; background-position: 0rpx 0rpx;}
height: 32rpx; .icon-customer-2 { width: 400rpx; height: 400rpx; background-position: -410rpx 0rpx;}
background-position: -1032rpx -60rpx; .icon-face-error-active { width: 96rpx; height: 96rpx; background-position: -820rpx -610rpx;}
} .icon-face-error { width: 96rpx; height: 96rpx; background-position: 0rpx -780rpx;}
.icon-back { .icon-face-success-active { width: 96rpx; height: 96rpx; background-position: -106rpx -780rpx;}
width: 128rpx; .icon-face-success { width: 96rpx; height: 96rpx; background-position: -212rpx -780rpx;}
height: 50rpx; .icon-feedback { width: 32rpx; height: 32rpx; background-position: -1032rpx -150rpx;}
background-position: -942rpx 0rpx; .icon-first-nav { width: 464rpx; height: 176rpx; background-position: 0rpx -410rpx;}
} .icon-home-active { width: 80rpx; height: 80rpx; background-position: -942rpx -60rpx;}
.icon-change-account { .icon-home { width: 80rpx; height: 80rpx; background-position: -942rpx -150rpx;}
width: 32rpx; .icon-icon-addr { width: 32rpx; height: 32rpx; background-position: -1032rpx -192rpx;}
height: 32rpx; .icon-icon-avatar { width: 112rpx; height: 112rpx; background-position: -820rpx 0rpx;}
background-position: -1032rpx -102rpx; .icon-icon-female { width: 32rpx; height: 32rpx; background-position: -1032rpx -240rpx;}
} .icon-icon-handshake { width: 72rpx; height: 72rpx; background-position: -942rpx -420rpx;}
.icon-customer-1 { .icon-icon-male { width: 32rpx; height: 32rpx; background-position: -1032rpx -282rpx;}
width: 400rpx; .icon-icon-shop { width: 32rpx; height: 32rpx; background-position: -1032rpx -330rpx;}
height: 400rpx; .icon-icon-upload { width: 128rpx; height: 128rpx; background-position: -644rpx -410rpx;}
background-position: 0rpx 0rpx; .icon-icon-weixin { width: 32rpx; height: 32rpx; background-position: -1032rpx -372rpx;}
} .icon-kf-0 { width: 32rpx; height: 32rpx; background-position: -1016rpx -576rpx;}
.icon-customer-2 { .icon-kf-1 { width: 32rpx; height: 32rpx; background-position: -1012rpx -650rpx;}
width: 400rpx; .icon-kf-2 { width: 32rpx; height: 32rpx; background-position: -1012rpx -720rpx;}
height: 400rpx; .icon-kf-3 { width: 32rpx; height: 32rpx; background-position: -1012rpx -790rpx;}
background-position: -410rpx 0rpx; .icon-logo { width: 160rpx; height: 160rpx; background-position: -474rpx -410rpx;}
} .icon-new-addr { width: 32rpx; height: 32rpx; background-position: -820rpx -716rpx;}
.icon-face-error-active { .icon-new-avatar { width: 96rpx; height: 96rpx; background-position: -318rpx -780rpx;}
width: 96rpx; .icon-new-feedback { width: 64rpx; height: 64rpx; background-position: -942rpx -502rpx;}
height: 96rpx; .icon-new-home-active { width: 112rpx; height: 112rpx; background-position: -820rpx -122rpx;}
background-position: -820rpx -610rpx; .icon-new-home { width: 112rpx; height: 112rpx; background-position: -820rpx -244rpx;}
} .icon-new-record-active { width: 112rpx; height: 112rpx; background-position: -820rpx -366rpx;}
.icon-face-error { .icon-new-record { width: 112rpx; height: 112rpx; background-position: -820rpx -488rpx;}
width: 96rpx; .icon-new-setting { width: 64rpx; height: 64rpx; background-position: -942rpx -576rpx;}
height: 96rpx; .icon-pen-active { width: 120rpx; height: 120rpx; background-position: -490rpx -596rpx;}
background-position: 0rpx -780rpx; .icon-pen { width: 120rpx; height: 120rpx; background-position: -620rpx -596rpx;}
} .icon-qr-success { width: 96rpx; height: 96rpx; background-position: -424rpx -780rpx;}
.icon-face-success-active { .icon-qw { width: 48rpx; height: 48rpx; background-position: -1016rpx -502rpx;}
width: 96rpx; .icon-record-active { width: 80rpx; height: 80rpx; background-position: -942rpx -240rpx;}
height: 96rpx; .icon-record { width: 80rpx; height: 80rpx; background-position: -942rpx -330rpx;}
background-position: -106rpx -780rpx; .icon-scene-0 { width: 96rpx; height: 96rpx; background-position: -530rpx -780rpx;}
} .icon-scene-1 { width: 96rpx; height: 96rpx; background-position: -636rpx -780rpx;}
.icon-face-success { .icon-search { width: 40rpx; height: 40rpx; background-position: -1024rpx -420rpx;}
width: 96rpx; .icon-second-nav { width: 480rpx; height: 128rpx; background-position: 0rpx -596rpx;}
height: 96rpx; .icon-setting { width: 32rpx; height: 32rpx; background-position: -862rpx -716rpx;}
background-position: -212rpx -780rpx; .icon-store { width: 96rpx; height: 96rpx; background-position: -742rpx -780rpx;}
} .icon-tool-file { width: 60rpx; height: 60rpx; background-position: -942rpx -650rpx;}
.icon-feedback { .icon-tool-finish { width: 60rpx; height: 60rpx; background-position: -942rpx -720rpx;}
width: 32rpx; .icon-tool-pay { width: 60rpx; height: 60rpx; background-position: -942rpx -790rpx;}
height: 32rpx;
background-position: -1032rpx -150rpx;
}
.icon-first-nav {
width: 464rpx;
height: 176rpx;
background-position: 0rpx -410rpx;
}
.icon-home-active {
width: 80rpx;
height: 80rpx;
background-position: -942rpx -60rpx;
}
.icon-home {
width: 80rpx;
height: 80rpx;
background-position: -942rpx -150rpx;
}
.icon-icon-addr {
width: 32rpx;
height: 32rpx;
background-position: -1032rpx -192rpx;
}
.icon-icon-avatar {
width: 112rpx;
height: 112rpx;
background-position: -820rpx 0rpx;
}
.icon-icon-female {
width: 32rpx;
height: 32rpx;
background-position: -1032rpx -240rpx;
}
.icon-icon-handshake {
width: 72rpx;
height: 72rpx;
background-position: -942rpx -420rpx;
}
.icon-icon-male {
width: 32rpx;
height: 32rpx;
background-position: -1032rpx -282rpx;
}
.icon-icon-shop {
width: 32rpx;
height: 32rpx;
background-position: -1032rpx -330rpx;
}
.icon-icon-upload {
width: 128rpx;
height: 128rpx;
background-position: -644rpx -410rpx;
}
.icon-icon-weixin {
width: 32rpx;
height: 32rpx;
background-position: -1032rpx -372rpx;
}
.icon-kf-0 {
width: 32rpx;
height: 32rpx;
background-position: -1016rpx -576rpx;
}
.icon-kf-1 {
width: 32rpx;
height: 32rpx;
background-position: -1012rpx -650rpx;
}
.icon-kf-2 {
width: 32rpx;
height: 32rpx;
background-position: -1012rpx -720rpx;
}
.icon-kf-3 {
width: 32rpx;
height: 32rpx;
background-position: -1012rpx -790rpx;
}
.icon-logo {
width: 160rpx;
height: 160rpx;
background-position: -474rpx -410rpx;
}
.icon-new-addr {
width: 32rpx;
height: 32rpx;
background-position: -820rpx -716rpx;
}
.icon-new-avatar {
width: 96rpx;
height: 96rpx;
background-position: -318rpx -780rpx;
}
.icon-new-feedback {
width: 64rpx;
height: 64rpx;
background-position: -942rpx -502rpx;
}
.icon-new-home-active {
width: 112rpx;
height: 112rpx;
background-position: -820rpx -122rpx;
}
.icon-new-home {
width: 112rpx;
height: 112rpx;
background-position: -820rpx -244rpx;
}
.icon-new-record-active {
width: 112rpx;
height: 112rpx;
background-position: -820rpx -366rpx;
}
.icon-new-record {
width: 112rpx;
height: 112rpx;
background-position: -820rpx -488rpx;
}
.icon-new-setting {
width: 64rpx;
height: 64rpx;
background-position: -942rpx -576rpx;
}
.icon-pen-active {
width: 120rpx;
height: 120rpx;
background-position: -490rpx -596rpx;
}
.icon-pen {
width: 120rpx;
height: 120rpx;
background-position: -620rpx -596rpx;
}
.icon-qw {
width: 48rpx;
height: 48rpx;
background-position: -1016rpx -502rpx;
}
.icon-record-active {
width: 80rpx;
height: 80rpx;
background-position: -942rpx -240rpx;
}
.icon-record {
width: 80rpx;
height: 80rpx;
background-position: -942rpx -330rpx;
}
.icon-scene-0 {
width: 96rpx;
height: 96rpx;
background-position: -424rpx -780rpx;
}
.icon-scene-1 {
width: 96rpx;
height: 96rpx;
background-position: -530rpx -780rpx;
}
.icon-search {
width: 40rpx;
height: 40rpx;
background-position: -1024rpx -420rpx;
}
.icon-second-nav {
width: 480rpx;
height: 128rpx;
background-position: 0rpx -596rpx;
}
.icon-setting {
width: 32rpx;
height: 32rpx;
background-position: -862rpx -716rpx;
}
.icon-store {
width: 96rpx;
height: 96rpx;
background-position: -636rpx -780rpx;
}
.icon-tool-file {
width: 60rpx;
height: 60rpx;
background-position: -942rpx -650rpx;
}
.icon-tool-finish {
width: 60rpx;
height: 60rpx;
background-position: -942rpx -720rpx;
}
.icon-tool-pay {
width: 60rpx;
height: 60rpx;
background-position: -942rpx -790rpx;
}
.icon-customer-1 {
width: 400rpx;
height: 400rpx;
background-position: 0rpx 0rpx;
}
.icon-customer-2 {
width: 400rpx;
height: 400rpx;
background-position: -410rpx 0rpx;
}
.icon-aito {
width: 320rpx;
height: 36rpx;
background-position: 0rpx -734rpx;
}
.icon-qr-success {
width: 96rpx;
height: 96rpx;
background-position: -742rpx -780rpx;
}
\ No newline at end of file \ No newline at end of file

937 KB | W: | H:

937 KB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
v-if="isFooter" v-if="isFooter"
> >
<view <view
v-if="showCancelBtn"
class="tips-btn close" class="tips-btn close"
@click="cancel()" @click="cancel()"
>{{ >{{
...@@ -106,7 +107,11 @@ export default { ...@@ -106,7 +107,11 @@ export default {
default: "取消", default: "取消",
}, },
maxHeight: Number, maxHeight: Number,
back: Boolean back: Boolean,
showCancelBtn: {
type: Boolean,
default: true,
}
}, },
methods: { methods: {
close () { close () {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<view class="box"> <view class="box">
<view <view
class="icon-close-box flex" class="icon-close-box flex"
@click="$refs.qr.close()" @click="close"
> >
<uni-icons <uni-icons
class="icon-close" class="icon-close"
......
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
<view class="select-box"> <view class="select-box">
<view <view
class="select-item" class="select-item"
:class="{ checked: couponId == item.id }" :class="{ checked: pageParams.couponId == item.id }"
@click="chooseCoupon(item)" @click="chooseCoupon(item)"
v-for="(item, index) in couponList" v-for="(item, index) in couponList"
:key="index" :key="index"
...@@ -116,10 +116,16 @@ ...@@ -116,10 +116,16 @@
</view> </view>
</view> </view>
</MessageBox> </MessageBox>
<MessageBox
ref="couponTips"
content="该门店礼券已使用完,请联系管理员配置。"
:showCancelBtn="false"
confirmBtnText="知道了"
></MessageBox>
<qr-box <qr-box
:url="QRURL" :url="pageParams.QRURL"
ref="qrbox" ref="qrbox"
:received="received" :received="pageParams.received"
@close="closeQr" @close="closeQr"
/> />
</view> </view>
...@@ -174,11 +180,13 @@ export default { ...@@ -174,11 +180,13 @@ export default {
couponList: [], couponList: [],
couponTypeName: '', couponTypeName: '',
focusIndex: -1, focusIndex: -1,
couponId: '', pageParams: {
carInfo: {}, qrTimer: null,
QRURL: '', received: false,
received: false, couponId: '',
qrTimer: null carInfo: {},
QRURL: '',
}
} }
}, },
watch: { watch: {
...@@ -190,6 +198,13 @@ export default { ...@@ -190,6 +198,13 @@ export default {
}, },
show (n) { show (n) {
if (n && this.customerType == 1) this.init() if (n && this.customerType == 1) this.init()
},
watchStatus: {
immediate: true,
handler (newval) {
this.pageParams = this.$options.data.call(this).pageParams
this.resetFocusIndex()
}
} }
}, },
computed: { computed: {
...@@ -203,8 +218,6 @@ export default { ...@@ -203,8 +218,6 @@ export default {
methods: { methods: {
init () { init () {
this.qrTimer = null
this.resetFocusIndex()
this.findCouponList() this.findCouponList()
}, },
async findCouponList () { async findCouponList () {
...@@ -212,12 +225,28 @@ export default { ...@@ -212,12 +225,28 @@ export default {
{ shopMerchantId } = userInfo, { shopMerchantId } = userInfo,
{ list } = await uni.$api.boutiqueApi.findCouponList({ { list } = await uni.$api.boutiqueApi.findCouponList({
merchantIdList: [shopMerchantId] merchantIdList: [shopMerchantId]
}) }),
arr = []
if (list && list.length) { if (list && list.length) {
let item = list.find(e => e.couponType == 1) let couponTypeList = Array.from(new Set([...list.map((e) => e.couponType)]))
if (item && !this.couponId) this.chooseCoupon(item) couponTypeList.map((i) => {
} let item = []
this.couponList = list || [] list.map((e) => {
if (i == e.couponType) item.push(e)
})
if (item.length) arr.push(item.sort(function (a, b) {
return b.createdDate - a.createdDate
})[0])
})
let item = arr.find(e => e.couponType == 1),
item2 = arr.find(e => e.couponType == 18)
if (!this.pageParams.couponId) {
if (item) this.chooseCoupon(item) //默认填入类型为「太阳膜」类型
else if (item2) this.chooseCoupon(item) //次选填入「精品」类型
else this.chooseCoupon(arr[0]) // 无此两种类型情况默认带入任意类型礼券
}
} else this.$refs.couponTips.open()
this.couponList = arr
}, },
inputCustomer () { inputCustomer () {
this.$store.dispatch('setCustomerInfo', this.customerInfo) this.$store.dispatch('setCustomerInfo', this.customerInfo)
...@@ -230,7 +259,7 @@ export default { ...@@ -230,7 +259,7 @@ export default {
} else { } else {
this.$refs.carBrandListVisible.close() this.$refs.carBrandListVisible.close()
this.customerInfo.carModel = item.name this.customerInfo.carModel = item.name
this.carInfo = item this.pageParams.carInfo = item
} }
this.resetFocusIndex() this.resetFocusIndex()
this.$store.dispatch('setCustomerInfo', this.customerInfo) this.$store.dispatch('setCustomerInfo', this.customerInfo)
...@@ -247,7 +276,7 @@ export default { ...@@ -247,7 +276,7 @@ export default {
this.closeQr() this.closeQr()
}, },
chooseCoupon (item) { chooseCoupon (item) {
this.couponId = item.id this.pageParams.couponId = item.id
this.couponTypeName = item.couponTypeName this.couponTypeName = item.couponTypeName
this.$refs.couponBoxVisible.close() this.$refs.couponBoxVisible.close()
}, },
...@@ -256,7 +285,7 @@ export default { ...@@ -256,7 +285,7 @@ export default {
}, },
async createCoupon () { async createCoupon () {
try { try {
const { couponId, customerInfo, carInfo } = this const { pageParams: { couponId, carInfo }, customerInfo } = this
await this.validate() await this.validate()
uni.showLoading() uni.showLoading()
const { const {
...@@ -281,13 +310,12 @@ export default { ...@@ -281,13 +310,12 @@ export default {
uni.hideLoading() uni.hideLoading()
if (code == 0) { if (code == 0) {
if (data) { if (data) {
this.QRURL = data this.pageParams.QRURL = data
this.checkCustomerReceivedStatus(dayjs().format("YYYY-MM-DD HH:mm:ss")) this.checkCustomerReceivedStatus(dayjs().format("YYYY-MM-DD HH:mm:ss"))
this.$refs.qrbox.open() this.$refs.qrbox.open()
} }
else throw '生成小程序码失败,请重试!' else throw '生成小程序码失败,请重试!'
} else throw message } else throw message
console.log(data)
} catch (error) { } catch (error) {
console.log(error) console.log(error)
uni.showToast({ uni.showToast({
...@@ -298,7 +326,7 @@ export default { ...@@ -298,7 +326,7 @@ export default {
}, },
async validate () { async validate () {
const { customerName, phoneNumber, carModel, staffName } = this.customerInfo, const { customerName, phoneNumber, carModel, staffName } = this.customerInfo,
{ couponId } = this { couponId } = this.pageParams
// 检查车主姓名 // 检查车主姓名
if (!customerName) throw '请输入车主姓名' if (!customerName) throw '请输入车主姓名'
// 检查车主手机 // 检查车主手机
...@@ -312,26 +340,33 @@ export default { ...@@ -312,26 +340,33 @@ export default {
if (!couponId) throw '请选择礼券类型' if (!couponId) throw '请选择礼券类型'
}, },
checkCustomerReceivedStatus (receiveCouponStartTime) { checkCustomerReceivedStatus (receiveCouponStartTime) {
this.qrTimer = setInterval(async () => { try {
const { couponId, customerInfo } = this, this.pageParams.received = false
res = await uni.$api.boutiqueApi.findCustomerReceivedStatus({ this.pageParams.qrTimer = setInterval(async () => {
merchantCouponId: couponId, const { pageParams: { couponId }, customerInfo } = this,
customerPhone: customerInfo.phoneNumber, res = await uni.$api.boutiqueApi.findCustomerReceivedStatus({
receiveCouponStartTime merchantCouponId: couponId,
}) customerPhone: customerInfo.phoneNumber,
if (res.total) { receiveCouponStartTime
this.received = true })
this.closeQr() if (res && res.total) {
setTimeout(() => { this.pageParams.received = true
this.$refs.qrbox.close() this.closeQr()
}, 3e3) setTimeout(() => {
} this.$refs.qrbox.close()
}, 1e3) }, 3e3)
}
}, 1e3)
} catch (error) {
if (error) uni.showToast({
title: error,
icon: "none",
});
}
}, },
closeQr () { closeQr () {
console.log(this.qrTimer) clearInterval(this.pageParams.qrTimer)
clearInterval(this.qrTimer) this.pageParams.qrTimer = null
this.qrTimer = null
}, },
resetFocusIndex () { resetFocusIndex () {
......
...@@ -169,16 +169,16 @@ export default { ...@@ -169,16 +169,16 @@ export default {
this.init(); this.init();
}, },
async start () { async start () {
// const result = await this.$permision.requestAndroidPermission( const result = await this.$permision.requestAndroidPermission(
// "android.permission.RECORD_AUDIO" "android.permission.RECORD_AUDIO"
// ); );
// if (result !== 1) { if (result !== 1) {
// uni.showToast({ uni.showToast({
// title: "为了记录语音通话,请打开录音权限", title: "为了记录语音通话,请打开录音权限",
// icon: "none", icon: "none",
// }); });
// return; return;
// } }
this.$refs.customerTypeRef.open() this.$refs.customerTypeRef.open()
this.startAudio(); this.startAudio();
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!