Browse Source

upload

soldDate
HolyKnightIX 1 year ago
parent
commit
f51d9a9e11
3 changed files with 140 additions and 56 deletions
  1. +1
    -0
      app.js
  2. +129
    -55
      pages/coupon/detail/index.js
  3. +10
    -1
      project.config.json

+ 1
- 0
app.js View File

@@ -74,6 +74,7 @@ App({
},

login() {
console.log('login!');
let that = this;
tt.login({
success: (res => {


+ 129
- 55
pages/coupon/detail/index.js View File

@@ -484,73 +484,147 @@ Page({
* 获取用户信息
*/
onLoad(options) {
console.log(options, 'options');
if (options.mallTenantId || options.tenantId) {
tt.setStorageSync('locationSwitch', 0);
if (app.globalData.token) {
console.log(options, 'options');
if (options.mallTenantId || options.tenantId) {
tt.setStorageSync('locationSwitch', 0);
this.setData({
mallTenantId: options.mallTenantId || options.tenantId,
})
}

Http.get({
url: '/mall/subMall?isAll=1',
}).then(res => {
console.log(res.data, 'subMall');
const mallList = res.data
mallList.forEach((item, index) => {
if (item.tenantId == (options.mallTenantId || options.tenantId)) {
tt.setStorageSync('mallTenantId', options.mallTenantId || options.tenantId)
tt.setStorageSync('mallIndex', index)
}
})
}).catch(err => {})

this.setData({
mallTenantId: options.mallTenantId || options.tenantId,
mouldType: app.globalData.mouldType,
})
}
let that = this;
if (options.g) {
app.globalData.havePlayEd1 = true;
}
tt.showLoading({
title: "加载中..."
});
that.setData({
onshow: false
})
if (options && (options.couponChannelId || options.couponIds)) {

Http.get({
url: '/mall/subMall?isAll=1',
}).then(res => {
console.log(res.data, 'subMall');
const mallList = res.data
mallList.forEach((item, index) => {
if (item.tenantId == (options.mallTenantId || options.tenantId)) {
tt.setStorageSync('mallTenantId', options.mallTenantId || options.tenantId)
tt.setStorageSync('mallIndex', index)
if (options.couponIds) {
this.setData({
couponIds: options.couponIds
})
that.getDetail(options.couponIds, 'notendclock');
} else {
that.getDetail(options.couponChannelId, 'notendclock');
that.getSupId(options.couponChannelId)
}
})
}).catch(err => {})

this.setData({
mouldType: app.globalData.mouldType,
})
let that = this;
if (options.g) {
app.globalData.havePlayEd1 = true;
}
tt.showLoading({
title: "加载中..."
});
that.setData({
onshow: false
})
if (options && (options.couponChannelId || options.couponIds)) {

if (options.couponIds) {
}
/**
* 转赠判断
*/
if (options.cuserId) {
this.setData({
couponIds: options.couponIds
showCardOffer: true,
cardData: options
})
that.getDetail(options.couponIds, 'notendclock');
} else {
that.getDetail(options.couponChannelId, 'notendclock');
that.getSupId(options.couponChannelId)
this.getUserInfo()
}
that.setData({
couponChannelId: options.couponChannelId,
title: that.data.data.title ? that.data.data.title : '',
});
if (options.cardType) {
that.setData({
cardType: options.cardType
})
}
} else {
app.tokenCallback = token => {
console.log(options, 'options');
if (options.mallTenantId || options.tenantId) {
tt.setStorageSync('locationSwitch', 0);
this.setData({
mallTenantId: options.mallTenantId || options.tenantId,
})
}

Http.get({
url: '/mall/subMall?isAll=1',
}).then(res => {
console.log(res.data, 'subMall');
const mallList = res.data
mallList.forEach((item, index) => {
if (item.tenantId == (options.mallTenantId || options.tenantId)) {
tt.setStorageSync('mallTenantId', options.mallTenantId || options.tenantId)
tt.setStorageSync('mallIndex', index)
}
})
}).catch(err => {})

this.setData({
mouldType: app.globalData.mouldType,
})
let that = this;
if (options.g) {
app.globalData.havePlayEd1 = true;
}
tt.showLoading({
title: "加载中..."
});
that.setData({
onshow: false
})
if (options && (options.couponChannelId || options.couponIds)) {

if (options.couponIds) {
this.setData({
couponIds: options.couponIds
})
that.getDetail(options.couponIds, 'notendclock');
} else {
that.getDetail(options.couponChannelId, 'notendclock');
that.getSupId(options.couponChannelId)
}


}
/**
* 转赠判断
*/
if (options.cuserId) {
this.setData({
showCardOffer: true,
cardData: options
})
this.getUserInfo()
}
that.setData({
couponChannelId: options.couponChannelId,
title: that.data.data.title ? that.data.data.title : '',
});
if (options.cardType) {
that.setData({
cardType: options.cardType
})
}
}

}
/**
* 转赠判断
*/
if (options.cuserId) {
this.setData({
showCardOffer: true,
cardData: options
})
this.getUserInfo()
}
that.setData({
couponChannelId: options.couponChannelId,
title: that.data.data.title ? that.data.data.title : '',
});
if (options.cardType) {
that.setData({
cardType: options.cardType
})
}

},
getHtml(couponChannelId) {
Http.get({


+ 10
- 1
project.config.json View File

@@ -17,7 +17,7 @@
"projectname": "tt富茂C",
"condition": {
"miniprogram": {
"current": 1679365133968,
"current": 1679474738627,
"list": [
{
"id": 1678508631604,
@@ -72,6 +72,15 @@
"scene": "990001",
"launchFrom": "scan",
"location": "qr_code"
},
{
"id": 1679474738627,
"name": "detail",
"pathName": "pages/coupon/detail/index",
"query": "type=cd&couponChannelId=792625127019700224&tenantId=1033",
"scene": "027005",
"launchFrom": "live",
"location": "live_cart_card"
}
]
}


Loading…
Cancel
Save