Commit f739a300 by 前端

Merge branch 'v3.21.0' into 'master'

V3.21.0

See merge request !3
2 parents 23447180 e7bd0180
Showing 65 changed files with 1700 additions and 274 deletions
import { preReleaseAppId } from '~/config' import { preReleaseAppId } from '~/config'
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease'] const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
let index = 4 let index = 3
/** /**
* *
...@@ -108,7 +108,7 @@ const defaultMerchantId = { ...@@ -108,7 +108,7 @@ const defaultMerchantId = {
ip: '44211227', ip: '44211227',
dev: '44211227', dev: '44211227',
uat: '44211651', uat: '44211651',
prod: '44208317', prod: '44209566',
preRelease: '44209566' preRelease: '44209566'
}[target[index]] }[target[index]]
......
...@@ -64,9 +64,9 @@ module.exports = { ...@@ -64,9 +64,9 @@ module.exports = {
/**免费领取体验卡 */ /**免费领取体验卡 */
tolqFreecard(data) { tolqFreecard(data) {
return api.post({ return api.post({
method: `scrm.api.equity.h5.free.card.receive`, method: `scrm.api.equity.h5.free.card.receive`,
...data ...data
}, },
true true
) )
}, },
...@@ -87,10 +87,10 @@ module.exports = { ...@@ -87,10 +87,10 @@ module.exports = {
/**领取优惠券 */ /**领取优惠券 */
receiveCoupon(data) { receiveCoupon(data) {
return api.post({ return api.post({
method: `scrm.api.coupon.share.receive`, method: `scrm.api.coupon.share.receive`,
...data, ...data,
receiveSource: 4 receiveSource: 4
}, },
true true
) )
}, },
...@@ -187,4 +187,13 @@ module.exports = { ...@@ -187,4 +187,13 @@ module.exports = {
...data ...data
}) })
}, },
/**
* 领取调查问卷 商城券
*/
reciveQuestionnaireCoupon(data) {
return api.post({
method: `scrm.api.coupon.user.questionnaire.get`,
...data
})
},
} }
\ No newline at end of file \ No newline at end of file
...@@ -10,6 +10,7 @@ import equityApi from './equity' ...@@ -10,6 +10,7 @@ import equityApi from './equity'
import common from './common' import common from './common'
import entmicroApi from './entmicro' import entmicroApi from './entmicro'
import strategyApi from './strategy' import strategyApi from './strategy'
import questionnaireApi from './questionnaire'
module.exports = { module.exports = {
wechatApi, wechatApi,
...@@ -23,5 +24,6 @@ module.exports = { ...@@ -23,5 +24,6 @@ module.exports = {
equityApi, equityApi,
common, common,
entmicroApi, entmicroApi,
strategyApi strategyApi,
questionnaireApi
} }
\ No newline at end of file \ No newline at end of file
import api from '../request/http'
const projectName = 'material'
module.exports = {
/** 查询调查问卷详情 */
getQuestionnaireDetail(data = {}) {
return api.post({
method: 'marketing.api.activityQuestionnaireForm.detail',
projectName,
...data
})
},
/**
* 用户-调查问卷提交
*/
submitQuestionnaireForm(data = {}) {
return api.post({
method: 'marketing.api.activityQuestionnaireUserForm.add',
projectName,
...data
})
},
/**
* 调查问卷-领取红包
*/
receiveQuestionnaireRedEnvelope(data = {}) {
return api.post({
method: 'marketing.api.activityRedEnvelope.questionnaire.binding',
projectName,
...data
})
},
}
\ No newline at end of file \ No newline at end of file
...@@ -229,4 +229,11 @@ module.exports = { ...@@ -229,4 +229,11 @@ module.exports = {
true true
) )
}, },
// 获取门店列表
getStoreList(data) {
return api.post({
method: `scrm.api.shopmall.weapp.merchant.detail.list`,
...data
},true)
},
}; };
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"pages/tab/strategy/index", "pages/tab/strategy/index",
"pages/webView/webView", "pages/webView/webView",
"pages/Login/Login", "pages/Login/Login",
"pages/crowdfunding/blank/blank" "pages/crowdfunding/blank/blank"
], ],
"requiredPrivateInfos": [ "requiredPrivateInfos": [
"getLocation" "getLocation"
...@@ -24,8 +24,7 @@ ...@@ -24,8 +24,7 @@
"selectedColor": "#3772EC", "selectedColor": "#3772EC",
"backgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF",
"borderStyle": "white", "borderStyle": "white",
"list": [ "list": [{
{
"pagePath": "pages/tab/index/index", "pagePath": "pages/tab/index/index",
"text": "首页", "text": "首页",
"iconPath": "assets/images/home.png", "iconPath": "assets/images/home.png",
...@@ -57,8 +56,7 @@ ...@@ -57,8 +56,7 @@
} }
] ]
}, },
"subpackages": [ "subpackages": [{
{
"root": "packageIndex", "root": "packageIndex",
"pages": [ "pages": [
"pages/carLife/index", "pages/carLife/index",
...@@ -100,7 +98,8 @@ ...@@ -100,7 +98,8 @@
"pages/device/list/list", "pages/device/list/list",
"pages/device/tachograph/tachograph", "pages/device/tachograph/tachograph",
"pages/vehicleInfo/index/index", "pages/vehicleInfo/index/index",
"pages/vehicleInfo/carBrandList/carBrandList" "pages/vehicleInfo/carBrandList/carBrandList",
"pages/questionnaire/questionnaire"
] ]
}, },
{ {
...@@ -170,9 +169,9 @@ ...@@ -170,9 +169,9 @@
"authorize": "/components/Authorize/Authorize", "authorize": "/components/Authorize/Authorize",
"popup": "/components/Popup/Popup", "popup": "/components/Popup/Popup",
"goods-action": "/components/GoodsAction/GoodsAction", "goods-action": "/components/GoodsAction/GoodsAction",
"stepper": "/components/Stepper/Stepper" "stepper": "/components/Stepper/Stepper",
"store-select":"/components/Store/index"
}, },
"style": "v2",
"resolveAlias": { "resolveAlias": {
"~/*": "/*" "~/*": "/*"
}, },
...@@ -182,6 +181,5 @@ ...@@ -182,6 +181,5 @@
"desc": "你的位置信息将用于小程序位置接口的效果展示" "desc": "你的位置信息将用于小程序位置接口的效果展示"
} }
}, },
"plugins": {}, "plugins": {}
"__usePrivacyCheck__": false
} }
\ No newline at end of file \ No newline at end of file
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
position: relative; position: relative;
height: 100%; height: 100%;
} }
.textarea-box .textarea { .textarea-box .textarea {
position: absolute; position: absolute;
top: 0; top: 0;
...@@ -16,17 +17,22 @@ ...@@ -16,17 +17,22 @@
line-height: 32rpx; line-height: 32rpx;
word-break: break-all; word-break: break-all;
} }
._textarea_ { ._textarea_ {
width: 100%; width: 100%;
height: calc(100% - 40rpx); height: 100%;
} }
.textarea-box.showWordLimit .textarea { .textarea-box.showWordLimit .textarea {
height: calc(100% - 40rpx); padding-bottom: 32rpx;
box-sizing: border-box;
} }
.wordLimit { .wordLimit {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
right: 0; right: 0;
color: #999; font-size: 24rpx;
} color: #C6C6C6;
background-color: #fff;
}
\ No newline at end of file \ No newline at end of file
import { IMG_URL } from '~/config';
import { env } from '~/api/env/index'
import { MERCHANT_STATIC_LIST } from '~/utils/constants'
Component({
properties: {
show: {
type: Boolean,
observer(n) {
if (n) this.getMerchantList()
}
}
},
data: {
storeList: []
},
methods: {
closeModal() {
this.setData({
show: false
})
},
// 检查是否是首次
checkFirst() {
const FIRST = wx.p.storage.get('first_enter_miniprograme')
if (FIRST) {
this.setData({
show: false
})
return true
}
},
// 获取门店信息
async getMerchantList() {
const have_enter = this.checkFirst()
if (have_enter) return
// 获取mock配置门店
const MOCKDATA = wx.p.storage.get("mock_data");
let MerchantList = MERCHANT_STATIC_LIST[env]
if (MOCKDATA && MOCKDATA.add_wuye_merchant) {
const ADD_MERCHANT_LIST = MOCKDATA.add_wuye_merchant[env]
if (ADD_MERCHANT_LIST && ADD_MERCHANT_LIST.length) {
MerchantList = [...MerchantList, ...ADD_MERCHANT_LIST]
}
}
let storeList = [], index = 0
try {
storeList = await this.getMerchantListData(MerchantList)
if(!storeList) throw false
storeList.forEach((ele, i) => {
ele.merchantId = ele.merchantNo
if (this.defaultMerchant == ele.merchantId) {
index = i
}
})
this.setData({
storeList,
show: true
})
} catch (error) {
this.setData({
storeList:[],
show: false
})
}
},
// 选择门店
toSelect(e) {
const { item } = e.currentTarget.dataset
wx.p.storage.set('merchant_info', {
merchantId: item.merchantNo,
})
wx.$merchant_id = item.merchantNo
wx.p.storage.set('first_enter_merchantId', item.merchantNo)
wx.p.storage.set('first_enter_miniprograme', true)
this.triggerEvent('freshMerchant')
wx.p.eventbus.emit('STORE')
this.setData({
show: false
})
},
// 获取门店列表
async getMerchantListData(merchantIdList) {
const res = await wx.p.api.shopmallApi.getStoreList({ merchantIdList })
if (res.code == 0) return res.data
else return false
},
},
lifetimes: {
attached() {
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
.modal {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: rgba($color: #000000, $alpha: 0.6);
z-index: 9999;
}
.pannel {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 638rpx;
background: #FFFFFF;
border-radius: 8rpx;
padding-bottom: 30rpx;
.color-bg {
padding: 30rpx;
border-radius: 8rpx;
background-image: linear-gradient(180deg, #E3E8FC 0%, #FFFFFF 100%);
font-weight: 400;
font-size: 32rpx;
color: #333333;
display: flex;
align-items: center;
justify-content: center;
position: relative;
.close {
width: 32rpx;
height: 32rpx;
position: absolute;
right: 15rpx;
top: 50%;
transform: translateY(-50%);
}
}
.list_wrap {
.store_item {
padding: 20rpx 30rpx;
display: flex;
.cover {
width: 104rpx;
height: 104rpx;
transform: translateY(4rpx);
}
.info-wrap {
padding-left: 20rpx;
.title {
font-weight: 600;
font-size: 30rpx;
color: #333333;
margin-bottom: 8rpx;
}
.cell {
display: flex;
align-items: center;
margin-bottom: 4rpx;
.icon {
width: 28rpx;
height: 28rpx;
margin-right: 12rpx;
}
.text {
font-weight: 400;
font-size: 24rpx;
color: #666666;
line-height: 36rpx;
width: 400rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
}
}
}
\ No newline at end of file \ No newline at end of file
<view wx:if="{{show}}" class="modal">
<view wx:if="{{storeList.length}}" class="pannel">
<view class="color-bg">
选择您所在的小区
<!-- <glsx-image class="close" bind:tap="closeModal" webp src="login/close.png"></glsx-image> -->
</view>
<view class="list_wrap">
<block wx:for="{{storeList}}" wx:key="index">
<view bind:tap="toSelect" data-item="{{item}}" class="store_item">
<glsx-image class="cover" webp src="login/banner{{index?'1':'2'}}.png"></glsx-image>
<view class="info-wrap">
<view class="title">{{item.merchantName}}</view>
<view class="cell">
<glsx-image class="icon" webp src="login/phone.png"></glsx-image>
<view class="text">{{item.merchantLegalPersonPhone || '--'}}</view>
</view>
<view class="cell">
<glsx-image class="icon" webp src="login/address.png"></glsx-image>
<view class="text">{{item.merchantAddress || '--'}}</view>
</view>
</view>
</view>
</block>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -4,6 +4,11 @@ ...@@ -4,6 +4,11 @@
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@vant/weapp": {
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/@vant/weapp/-/weapp-1.11.1.tgz",
"integrity": "sha512-2QddSq3MsozbTBAgEmW1rhzsEJNWPF2VS427M5pOOn0a7/f6lW+tymwdTcOQCzQONavhFwBv6Lebbs/UjE3Yig=="
},
"glsx-applet-component": { "glsx-applet-component": {
"version": "1.1.24", "version": "1.1.24",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.24.tgz", "resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.24.tgz",
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
"version": "1.0.0", "version": "1.0.0",
"main": "app.js", "main": "app.js",
"dependencies": { "dependencies": {
"@vant/weapp": "^1.11.1",
"glsx-applet-component": "^1.1.24", "glsx-applet-component": "^1.1.24",
"glsx-map-sdk": "^0.2.0", "glsx-map-sdk": "^0.2.0",
"number-precision": "^1.6.0" "number-precision": "^1.6.0"
......
...@@ -36,6 +36,7 @@ Page({ ...@@ -36,6 +36,7 @@ Page({
buyType, buyType,
discoverGoodsSource discoverGoodsSource
} = obj } = obj
console.log(obj);
let ids = [], expressFee = 0, goodsNumber = 0 let ids = [], expressFee = 0, goodsNumber = 0
if (obj.deliveryType == 1) { if (obj.deliveryType == 1) {
this.getLocation() this.getLocation()
...@@ -365,7 +366,7 @@ Page({ ...@@ -365,7 +366,7 @@ Page({
} else { } else {
if (!contactInfo.contactName) { if (!contactInfo.contactName) {
contactInfo.contactAddress = ' ' contactInfo.contactAddress = ' '
contactInfo.contactName = this.data.userInfo.nickName contactInfo.contactName = this.data.userInfo.nickName || ' '
contactInfo.contactPhone = this.data.userInfo.phone contactInfo.contactPhone = this.data.userInfo.phone
// wx.p.wxApi.showToast('请选择收货地址') // wx.p.wxApi.showToast('请选择收货地址')
// return // return
...@@ -395,13 +396,13 @@ Page({ ...@@ -395,13 +396,13 @@ Page({
orderSource, orderSource,
orderCouponDTO, orderCouponDTO,
contactAddress:contactInfo.contactAddress || ' ', contactAddress:contactInfo.contactAddress || ' ',
contactName: contactInfo.contactName, contactName: contactInfo.contactName || ' ',
contactPhone: contactInfo.contactPhone, contactPhone: contactInfo.contactPhone,
userName: contactInfo.contactName, userName: contactInfo.contactName || ' ',
userPhone: contactInfo.contactPhone userPhone: contactInfo.contactPhone
} }
if(deliveryType==0){ if(deliveryType==0){
query.userName = this.data.userInfo.nickName query.userName = this.data.userInfo.nickName || this.data.userInfo.phone
query.userPhone = this.data.userInfo.phone query.userPhone = this.data.userInfo.phone
} }
wx.p.api.shopmallApi wx.p.api.shopmallApi
......
...@@ -70,11 +70,14 @@ Page({ ...@@ -70,11 +70,14 @@ Page({
customer_phone: phone customer_phone: phone
} }
if (nickName) { if (nickName) {
item.customer_name = nickName item.customer_qw_nickname = nickName
} }
if (headImgUrl) { if (headImgUrl) {
item.avatar = headImgUrl item.avatar = headImgUrl
} }
if (data.unionId) {
item.union_id = data.unionId
}
let json = JSON.stringify(item) let json = JSON.stringify(item)
// 数据上报 // 数据上报
wx.p.api.common.trackHttp({ json }).then(response => { }) wx.p.api.common.trackHttp({ json }).then(response => { })
...@@ -133,6 +136,10 @@ Page({ ...@@ -133,6 +136,10 @@ Page({
if (code == 0) { if (code == 0) {
// 获取会员卡信息 // 获取会员卡信息
wx.p.api.equityApi.checkOpenMember({ isTrialCardFlag: 1 }).then(res => { wx.p.api.equityApi.checkOpenMember({ isTrialCardFlag: 1 }).then(res => {
if (res.code == -1 && res.errId == 2008) {
this.showTips(message || '服务不可用')
return
}
if (res.code == 0 && res.data) { if (res.code == 0 && res.data) {
this.receiveRed(res.data.equityFreeCardId) this.receiveRed(res.data.equityFreeCardId)
} }
...@@ -148,11 +155,12 @@ Page({ ...@@ -148,11 +155,12 @@ Page({
}) })
}, },
receiveRed(equityFreeCardId) { receiveRed(equityFreeCardId) {
let { isOpenMember, nickName } = this.data let { isOpenMember, nickName, bindingSource } = this.data
let params = { let params = {
equityFreeCardId, equityFreeCardId,
nickName: nickName nickName: nickName
} }
if (bindingSource) params.bindingSource = bindingSource
wx.p.api.equityApi.checkReceiveRed(params).then(res => { wx.p.api.equityApi.checkReceiveRed(params).then(res => {
console.log(res, 'checkReceiveRed---') console.log(res, 'checkReceiveRed---')
let { code, message, data } = res let { code, message, data } = res
...@@ -180,6 +188,10 @@ Page({ ...@@ -180,6 +188,10 @@ Page({
const authStatus = await wx.p.router.intercept(false) const authStatus = await wx.p.router.intercept(false)
if (authStatus) return if (authStatus) return
wx.p.api.equityApi.checkOpenMember({ isTrialCardFlag: 1 }).then(res => { wx.p.api.equityApi.checkOpenMember({ isTrialCardFlag: 1 }).then(res => {
if (res.code == -1 && res.errId == 2008) {
this.showTips(res.message || '服务不可用')
return
}
let flag = false let flag = false
if (res.code == 0 && res.data) { if (res.code == 0 && res.data) {
flag = true flag = true
...@@ -212,11 +224,15 @@ Page({ ...@@ -212,11 +224,15 @@ Page({
}, },
async onLoad(options) { async onLoad(options) {
let system = wx.getSystemInfoSync() //从调查问卷来
let system = wx.getSystemInfoSync(),
bindingSource = ''
const authStatus = await wx.p.router.intercept(false) const authStatus = await wx.p.router.intercept(false)
const { merchantId } = wx.p.storage.get('merchant_info') const { merchantId } = wx.p.storage.get('merchant_info')
if (options.bindingSource) bindingSource = options.bindingSource
this.setData({ this.setData({
merchantId merchantId,
bindingSource
}) })
wx.p.wxApi.showLoading() wx.p.wxApi.showLoading()
const { const {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
width: 100%; width: 100%;
height: 664rpx; height: 664rpx;
position: relative; position: relative;
background-size: 100% 100%;
.title { .title {
position: absolute; position: absolute;
left: 50%; left: 50%;
...@@ -86,7 +86,12 @@ ...@@ -86,7 +86,12 @@
transform: translateX(-50%); transform: translateX(-50%);
} }
} }
.lq_g_bg{
background: url(https://img02.glsx.com.cn/weapp/resource/miniprogram/wuye/equity/coupons/lq_g_bg.png);
}
.lq_w_bag{
background: url(https://img02.glsx.com.cn/weapp/resource/miniprogram/wuye/equity/coupons/lq_w_bag.png);
}
.footer_rule_box { .footer_rule_box {
width: 100%; width: 100%;
display: flex; display: flex;
......
<view style="background: url({{IMGURL}}equity/coupons/lq_bg_max.png);background-size: 100% 100%;" class="container"> <view style="background: url({{IMGURL}}equity/coupons/lq_bg_max.png);background-size: 100% 100%;" class="container">
<view style="background: url({{IMGURL}}equity/coupons/{{handleStatus==1?'lq_g_bg':'lq_w_bag'}}.png);background-size: 100% 100%;" class="main_box"> <view class="main_box {{handleStatus==1?'lq_g_bg':'lq_w_bag'}}">
<view wx:if="{{detailInfo.denomination}}" class="title"> <view wx:if="{{detailInfo.denomination}}" class="title">
<text class="price">{{detailInfo.denomination || ''}}</text> <text class="price">{{detailInfo.denomination || ''}}</text>
<text class="unit">元</text> <text class="unit">元</text>
<text class="tip">无门槛</text> <text class="tip">无门槛</text>
</view>
<view class="info_box">
<view class="cover_box">
<image class="cover" src="{{detailInfo.goodsImage}}" />
</view>
<view class="right">
<view class="name">{{detailInfo.brandName}}</view>
<view class="desc">{{detailInfo.goodsName}}</view>
</view>
</view>
<view class="btn" bind:tap="toGet"></view>
</view> </view>
<view class="footer_rule_box"> <view class="info_box">
<view class="title">规则</view> <view class="cover_box">
<view class="box"> <image class="cover" src="{{detailInfo.goodsImage}}" />
<view class="line">1. 同一用户每张优惠券仅能领取1次,每次1张</view> </view>
<view class="line">2. 优惠券数量有限,领完即止</view> <view class="right">
</view> <view class="name">{{detailInfo.brandName}}</view>
<view class="desc">{{detailInfo.goodsName}}</view>
</view>
</view> </view>
<view class="btn" bind:tap="toGet"></view>
</view>
<view class="footer_rule_box">
<view class="title">规则</view>
<view class="box">
<view class="line">1. 同一用户每张优惠券仅能领取1次,每次1张</view>
<view class="line">2. 优惠券数量有限,领完即止</view>
</view>
</view>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -14,7 +14,6 @@ Page({ ...@@ -14,7 +14,6 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
wx.p.routerApi.decodeUrlLink(options)
if (!options.id) { if (!options.id) {
return return
} }
...@@ -48,8 +47,8 @@ Page({ ...@@ -48,8 +47,8 @@ Page({
showAuthBtn: res.data.phone ? false : true showAuthBtn: res.data.phone ? false : true
}) })
if (res.data.isLogin) { if (res.data.isLogin) {
wx.p.util.setUserInfo(res.data) wx.p.cache.userInfo.setUserInfo(res.data)
wx.p.util.setSessionId(res.data.sessionId) wx.p.cache.storageApi.setSessionId(res.data.sessionId)
this.handlerCustomerId() this.handlerCustomerId()
} }
} }
...@@ -68,8 +67,8 @@ Page({ ...@@ -68,8 +67,8 @@ Page({
wx.hideLoading() wx.hideLoading()
if (code == '0') { if (code == '0') {
wx.p.authStatus = false wx.p.authStatus = false
wx.p.util.setUserInfo(data) wx.p.cache.userInfo.setUserInfo(data)
wx.p.util.setSessionId(data.sessionId) wx.p.cache.storageApi.setSessionId(data.sessionId)
this.toCreatePackageNum() this.toCreatePackageNum()
this.handlerCustomerId() this.handlerCustomerId()
} else wx.p.wxApi.showToast(message) } else wx.p.wxApi.showToast(message)
...@@ -152,8 +151,8 @@ Page({ ...@@ -152,8 +151,8 @@ Page({
}, },
// 客户id // 客户id
handlerCustomerId() { handlerCustomerId() {
let customerId = wx.p.storage.get('srcm_shopmall_customer_id') // let customerId = wx.p.storage.get('srcm_shopmall_customer_id')
if (customerId) USERAPI.updataCustomerPhone() // if (customerId) USERAPI.updataCustomerPhone()
}, },
// 价格格式化 // 价格格式化
// priceFormat(num, point = 2) { // priceFormat(num, point = 2) {
...@@ -173,6 +172,6 @@ Page({ ...@@ -173,6 +172,6 @@ Page({
// } // }
// }, // },
onUnload: function () { onUnload: function () {
wx.$util.customerbehavior(2) // wx.$util.customerbehavior(2)
} }
}) })
...@@ -115,13 +115,14 @@ ...@@ -115,13 +115,14 @@
.button-item { .button-item {
width: 100%; width: 100%;
height: 88rpx; height: 88rpx;
background: #fc5b32; background: #3772EC;
border-radius: 8rpx; border-radius: 48rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 32rpx; font-size: 32rpx;
color: #ffffff; color: #ffffff;
border-radius:48rpx;
} }
.dis{ .dis{
background: #CCCCCC; background: #CCCCCC;
......
import QR from '~/lib/wxqrcode' import QR from '~/lib/wxqrcode'
import { IMG_URL } from '~/config'; import {
IMG_URL
} from '~/config';
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
...@@ -19,7 +20,7 @@ Page({ ...@@ -19,7 +20,7 @@ Page({
useMemberType: 0, useMemberType: 0,
list: [], list: [],
pageNum: 1, pageNum: 1,
IMGURL:IMG_URL IMGURL: IMG_URL
}, },
navbarReady(e) { navbarReady(e) {
this.setData({ this.setData({
...@@ -130,7 +131,6 @@ Page({ ...@@ -130,7 +131,6 @@ Page({
useMemberType, useMemberType,
detailInfo detailInfo
}) => { }) => {
console.log(userCouponId)
wx.p.wxApi.showLoading('加载中...') wx.p.wxApi.showLoading('加载中...')
this.setData({ this.setData({
detailInfo detailInfo
...@@ -154,6 +154,12 @@ Page({ ...@@ -154,6 +154,12 @@ Page({
if (options && options.couponId) { if (options && options.couponId) {
console.log(options) console.log(options)
wx.p.wxApi.showLoading('加载中...') wx.p.wxApi.showLoading('加载中...')
if (options.bindingSource) {
this.setData({
bindingSource: options.bindingSource
})
return this.getCouponInfo(options.couponId)
}
this.checkCoupon(options) this.checkCoupon(options)
if (options.activity_id) { if (options.activity_id) {
this.data.activiOptions = options this.data.activiOptions = options
...@@ -166,6 +172,14 @@ Page({ ...@@ -166,6 +172,14 @@ Page({
if (isReceive) this.confirm() if (isReceive) this.confirm()
} }
}, },
/**调查问卷查询券详情 */
async getCouponInfo(couponId) {
const res = await wx.p.api.couponsApi.getCouponInfo({
couponId
})
wx.hideLoading()
this.setCouponData(res)
},
checkCoupon(options, callBack) { checkCoupon(options, callBack) {
wx.p.api.couponsApi.checkCoupon(options).then(couponInfo => { wx.p.api.couponsApi.checkCoupon(options).then(couponInfo => {
console.log(couponInfo) console.log(couponInfo)
...@@ -229,8 +243,30 @@ Page({ ...@@ -229,8 +243,30 @@ Page({
issueDate, issueDate,
userCouponId, userCouponId,
merchantId, merchantId,
shareSource shareSource,
bindingSource
} = this.data } = this.data
// 调查问卷
if (bindingSource) {
const {
couponDetail
} = this.data
wx.p.api.couponsApi.reciveQuestionnaireCoupon({
merchantId: couponDetail.merchantId,
couponId: couponDetail.id
}).then(res => {
if (res.discountType == 3) {
this.jump()
return
}
this.setData({
qr: QR.createQrCodeImg(`t=2&c=${res.verificationCode}`),
verificationCode: res.verificationCode
})
wx.p.wxApi.showToast('领取成功')
})
return
}
if (!couponId && !userCouponId) return if (!couponId && !userCouponId) return
wx.p.router.intercept().then(response => { wx.p.router.intercept().then(response => {
if (response) { if (response) {
......
...@@ -472,11 +472,11 @@ Page({ ...@@ -472,11 +472,11 @@ Page({
} }
// 配置升级 // 配置升级
if (options && options.isUpgrade) { if (options && options.isUpgrade) {
this.isUpgrade = options.isUpgrade this.isUpgrade = JSON.parse(options.isUpgrade)
} }
// 车主优选 // 车主优选
if (options && options.isCarOwner) { if (options && options.isCarOwner) {
this.isCarOwner = options.isCarOwner this.isCarOwner = JSON.parse(options.isCarOwner)
} }
this.appHide() this.appHide()
}, },
......
...@@ -218,7 +218,7 @@ Page({ ...@@ -218,7 +218,7 @@ Page({
} }
let list = [] let list = []
wx.p.api.mineApi.getOrderList(obj).then((data) => { wx.p.api.mineApi.getOrderList(obj).then((data) => {
wx.hideLoading() // wx.hideLoading()
data?.list?.map((e) => { data?.list?.map((e) => {
let { let {
orderGoods, orderGoods,
......
// packageMine/pages/questionnaire/components/Cascader/Cascader.js
Component({
/**
* 组件的属性列表
*/
properties: {
title: String,
data: Array,
num: Number
},
/**
* 组件的初始数据
*/
data: {
show: false,
fieldValue: '',
cascaderValue: ''
},
/**
* 组件的方法列表
*/
methods: {
onClick() {
this.setData({
show: true,
})
},
onClose() {
this.setData({
show: false
})
},
onFinish(e) {
const {
selectedOptions,
value
} = e.detail, {
num
} = this.data,
fieldValue = selectedOptions.map((option) => option.text || option.name).join('/')
this.setData({
fieldValue,
cascaderValue: value
})
this.triggerEvent('change', {
num,
value: fieldValue
})
this.onClose()
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {
"van-cascader": "@vant/weapp/cascader/index",
"van-popup":"@vant/weapp/popup/index"
}
}
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/questionnaire/components/Cascader/Cascader.wxss */
@import '../Select/Select.scss';
<view class="select {{!fieldValue?'default':''}} {{show?'focus':''}}" bindtap="onClick">
<view class="value">
{{fieldValue||'请选择'}}
</view>
</view>
<van-popup show="{{ show }}" round position="bottom" bind:click-overlay="onClose">
<van-cascader title="{{title}}" value="{{ cascaderValue }}" active-color="#3772EC" options="{{ data }}" bindclose="onClose" bindfinish="onFinish" >
</van-cascader>
</van-popup>
\ No newline at end of file \ No newline at end of file
// packageMine/pages/questionnaire/components/Checkbox/Checkbox.js
Component({
/**
* 组件的属性列表
*/
properties: {
data: Array,
num: Number
},
/**
* 组件的初始数据
*/
data: {
chooseList: [],
valueList: []
},
/**
* 组件的方法列表
*/
methods: {
choose(e) {
const {
index,
value
} = e.currentTarget.dataset, {
chooseList,
valueList,
num
} = this.data,
item = chooseList.findIndex(i => i == index)
if (item == -1) {
chooseList.push(index)
valueList.push(value)
} else {
chooseList.splice(item, 1)
valueList.splice(item, 1)
}
this.setData({
chooseList,
valueList
})
this.triggerEvent('change', {
num,
value: valueList.join(';') || null
})
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/questionnaire/components/Checkbox/Checkbox.wxss */
.checkbox-item {
margin-bottom: 20rpx;
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
display: flex;
align-items: center;
word-wrap: break-word;
.icon {
width: 24rpx;
height: 24rpx;
border: 2rpx solid #999999;
border-radius: 4rpx;
flex-shrink: 0;
margin-right: 10rpx;
transition: all .25s;
}
.active {
border-color: var(--themeColor);
position: relative;
&::after {
width: 28rpx;
height: 28rpx;
content: '';
position: absolute;
top: 50%;
left: 50%;
animation: radio-active .25s forwards;
background: url(https://img02.glsx.com.cn/weapp/resource/miniprogram/wuye/questionnaire/checkbox.png) no-repeat;
background-size: 100%;
}
}
@keyframes radio-active {
0%{
opacity: 0;
transform: translate(-50%,-50%) scale(.1);
}
100%{
opacity: 1;
transform: translate(-50%,-50%) scale(1);
}
}
}
\ No newline at end of file \ No newline at end of file
<wxs module="fn">
module.exports = {
includes: function (arr, val) {
return arr.indexOf(val) != -1
}
}
</wxs>
<block wx:for="{{data}}" wx:key="index">
<view class="checkbox-item" bindtap="choose" data-index="{{index}}" data-value="{{item}}">
<view class="icon {{fn.includes(chooseList,index)?'active':''}}"></view>
{{item}}
</view>
</block>
// packageMine/pages/questionnaire/components/Finish/Finish.js
Component({
/**
* 组件的属性列表
*/
properties: {
data: Object
},
/**
* 组件的初始数据
*/
data: {
count: 5
},
lifetimes: {
async attached() {
const {
data
} = this.data
if (data.activityType) {
let url = '/packageEquity/pages/freecard/freecard',
options = {
bindingSource: 1,
notIntercept: true
}
if (data.activityType == 3) {
const {
userInfo
} = wx.p.router.getPageInstance().data
const res = await wx.p.api.questionnaireApi.receiveQuestionnaireRedEnvelope({
questionnaireId: data.id,
activityRedEnvelopeId: data.activityId,
nickName: userInfo.nickName
})
if (res.isActivityRedEnvelopeFlag && !res.isReceiveFlag) this.setData({
jumpOption: {
url: res.activityRedEnvelopeLink,
type: data.activityType
}
})
this.countDown()
} else {
if (data.activityType == 2) {
options.couponId = data.activityId
url = '/packageMall/pages/coupon/coupon'
}
this.setData({
jumpOption: {
url,
type: data.activityType,
options
}
})
this.countDown()
}
} else this.countDown()
}
},
timer: null,
/**
* 组件的方法列表
*/
methods: {
async back() {
clearTimeout(this.timer)
this.timer = null
const {
jumpOption
} = this.data
if (jumpOption) {
if (jumpOption.type == 3) wx.p.router.switchTab('/pages/tab/index/index', {
jumpH5Url: jumpOption.url
})
else wx.p.router.redirectTo(jumpOption.url, jumpOption.options)
} else wx.p.router.goHome()
},
countDown() {
this.timer = setTimeout(() => {
let {
count
} = this.data
if (this.timer && count == 0) {
clearTimeout(this.timer)
this.back()
return
}
--count
this.setData({
count
})
this.countDown()
}, 1e3)
}
},
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/questionnaire/components/Finish/Finish.wxss */
@keyframes show-finish{
0%{
left: 100vw;
}
100%{
left: 0;
}
}
.finish-box {
position: fixed;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
background-color: #fff;
display: flex;
flex-direction: column;
align-items: center;
font-weight: 500;
font-size: 40rpx;
color: #333333;
animation: show-finish .25s forwards;
.icon {
width: 160rpx;
height: 160rpx;
margin: 160rpx 0 30rpx;
}
.btn {
margin: 40% 0 30rpx;
width: 494rpx;
height: 88rpx;
background: #3772EC;
border-radius: 44rpx;
color: #fff;
font-weight: 500;
font-size: 32rpx;
letter-spacing: 2rpx;
display: flex;
align-items: center;
justify-content: center;
}
.tips {
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
}
// 提示
.member-dialog {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 998;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.bg {
position: absolute;
width: 100%;
height: 100%;
z-index: -1;
background: rgba(0, 0, 0, .5);
}
.content {
position: relative;
text-align: center;
box-sizing: border-box;
.member-bg {
width: 550rpx;
height: 910rpx;
}
.count-down {
position: absolute;
top: 26rpx;
right: 26rpx;
width: 72rpx;
height: 72rpx;
line-height: 72rpx;
background: #EA4D3A;
border-radius: 36rpx;
font-weight: 600;
font-size: 42rpx;
color: #FFFFFF;
}
.open-btn {
position: absolute;
bottom: 50rpx;
left: 28%;
width: 158rpx;
height: 158rpx;
}
}
}
\ No newline at end of file \ No newline at end of file
<view class="finish-box">
<view class="icon">
<glsx-image src="questionnaire/finish.png" />
</view>
提交成功
<view class="btn" bindtap="back">返回</view>
<view class="tips">{{count}}S后自动跳转</view>
</view>
<!-- 红包会员弹窗 -->
<block wx:if="{{data.activityType == 3 && jumpOption}}">
<view class="member-dialog">
<view class="bg" />
<view class="content">
<view class="count-down">{{count}}</view>
<glsx-image class="member-bg" src="equity/bg-red.png"></glsx-image>
<glsx-image bindtap="back" class="open-btn" src="equity/icon-open.png"></glsx-image>
</view>
</view>
</block>
\ No newline at end of file \ No newline at end of file
// packageMine/pages/questionnaire/components/Radio/Radio.js
Component({
/**
* 组件的属性列表
*/
properties: {
data: Array,
num: Number
},
/**
* 组件的初始数据
*/
data: {
raidoIndex: -1
},
/**
* 组件的方法列表
*/
methods: {
choose(e) {
const {
index,
value
} = e.currentTarget.dataset, {
raidoIndex,
num
} = this.data
if (raidoIndex == index) return
this.setData({
raidoIndex: index
})
this.triggerEvent('change', {
num,
value
})
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/questionnaire/components/Radio/Radio.wxss */
.radio-item {
margin-bottom: 20rpx;
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
display: flex;
align-items: center;
word-wrap: break-word;
.icon {
width: 24rpx;
height: 24rpx;
border: 2rpx solid #999999;
border-radius: 100%;
flex-shrink: 0;
margin-right: 10rpx;
transition: all .25s;
}
.active {
position: relative;
border-color: var(--themeColor);
&::after {
width: 18rpx;
height: 18rpx;
border-radius: 100%;
background-color: var(--themeColor);
content: '';
position: absolute;
top: 50%;
left: 50%;
animation: radio-active .25s forwards;
}
}
@keyframes radio-active {
0% {
opacity: 0;
transform: translate(-50%, -50%) scale(.1);
}
100% {
opacity: 1;
transform: translate(-50%, -50%) scale(1);
}
}
}
\ No newline at end of file \ No newline at end of file
<block wx:for="{{data}}" wx:key="index">
<view class="radio-item" bindtap="choose" data-index="{{index}}" data-value="{{item}}">
<view class="icon {{index == raidoIndex?'active':''}}"></view>
{{item}}
</view>
</block>
\ No newline at end of file \ No newline at end of file
// packageMine/pages/questionnaire/components/Select/Select.js
Component({
/**
* 组件的属性列表
*/
properties: {
data: Array,
title: String,
num: Number
},
/**
* 组件的初始数据
*/
data: {
value: '',
show: false
},
/**
* 组件的方法列表
*/
methods: {
onClick() {
this.setData({
show: true,
})
},
onClose() {
this.setData({
show: false
})
},
onConfirm(e) {
const {
value
} = e.detail, {
num
} = this.data
this.setData({
value
})
this.triggerEvent('change', {
num,
value
})
this.onClose()
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {
"van-popup":"@vant/weapp/popup/index",
"van-picker": "@vant/weapp/picker/index"
}
}
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/questionnaire/components/Select/Select.wxss */
.select {
width: 100%;
height: 72rpx;
background: #FFFFFF;
border: 2rpx solid #D9D9D9;
border-radius: 8rpx;
box-sizing: border-box;
padding: 16rpx 20rpx;
font-size: 28rpx;
position: relative;
overflow: hidden;
color: #333;
&::after {
position: absolute;
content: '';
border: 2rpx solid #999;
border-top: none;
border-left: none;
right: 20rpx;
top: 50%;
transform: translateY(-50%) rotate(45deg);
box-sizing: border-box;
width: 16.14rpx;
height: 16.14rpx;
transition: all .25s;
}
.value {
width: calc(100% - 44rpx);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.focus {
&::after {
transform: translateY(-20%) rotate(225deg);
}
}
.default {
color: #999999;
}
.active {
color: var(--themeColor);
}
\ No newline at end of file \ No newline at end of file
<view class="select {{!value?'default':''}} {{show?'focus':''}}" bindtap="onClick">
<view class="value">
{{value||'请选择'}}
</view>
</view>
<van-popup show="{{ show }}" round position="bottom" bind:click-overlay="onClose">
<van-picker show-toolbar title="{{title}}" columns="{{ data }}" bind:cancel="onClose" bind:confirm="onConfirm" active-class="active" />
</van-popup>
\ No newline at end of file \ No newline at end of file
// packageMine/pages/questionnaire/questionnaire.js
Page({
/**
* 页面的初始数据
*/
data: {
finish: false
},
answerList: {},
blur(e) {
const {
value
} = e.detail, {
num
} = e.currentTarget.dataset
this.change({
detail: {
num,
value
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
async getQuestionnaireDetail(options) {
const res = await wx.p.router.intercept()
if (!res) {
const {
userInfo
} = this.data
if (!userInfo.nickName) return this.getNickNameAndHeadUrl()
try {
const data = await wx.p.api.questionnaireApi.getQuestionnaireDetail(options)
if (data.status == -1) {
return wx.showModal({
title: '温馨提示',
content: '问卷活动已结束。',
showCancel: false,
confirmText: '返回首页',
confirmColor: '#3772EC',
complete: (res) => {
if (res.confirm) wx.p.router.goHome()
}
})
}
if (data) {
data.questions.map(e => {
if (e.type != 3) {
let option = e.option.split('\n')
if (e.type == 5) {
const [, two, three] = option[0].split('/')
option.splice(0, 1)
e.data = this.transformData(option, three ? 3 : two ? 2 : 1)
} else e.data = option
}
e.answer = ''
e.userFormId = e.formId
})
this.setData({
questionnaireObj: data
})
wx.setNavigationBarTitle({
title: data.title,
})
this.shareTitle = data.cardTitle || data.title
this.shareQuery = `id=${data.id}`
this.shareImage = data.cardCover || ''
this.addTrackInfo()
} else throw '获取问卷失败'
} catch (error) {
console.log(error)
if (error) wx.p.wxApi.showToast(error)
}
}
},
transformData(data, childrenDepth) {
const result = []
data.forEach(item => {
const levels = item.split('/')
let currentLevel = result
for (let i = 0; i < childrenDepth; i++) {
const text = levels[i],
value = text,
existingOption = currentLevel && currentLevel.find((option) => option.text === text)
if (existingOption) {
if (i === childrenDepth - 1) {
continue
}
if (existingOption.children) currentLevel = existingOption.children
} else {
if (text && value) {
const newOption = {
text,
value,
}
if (levels[i + 1]) newOption.children = []
currentLevel.push(newOption)
if (i === childrenDepth - 1) delete newOption.children
currentLevel = newOption.children
}
}
}
})
return result
},
change(e) {
const {
num,
value
} = e.detail
this.answerList[num] = value
},
async submit() {
const {
questionnaireObj
} = this.data, {
merchantId,
} = wx.p.storage.get('userInfo'), {
answerList
} = this
try {
let questions = []
questionnaireObj.questions.map(e => {
if (e.required && answerList[e.num] == null) throw `请填写第${e.num}题!`
questions.push({
userFormId: e.userFormId,
num: e.num,
answer: answerList[e.num] || ''
})
})
let params = {
questions,
merchantId,
formId: questionnaireObj.id,
}
console.log(params)
const res = await wx.p.api.questionnaireApi.submitQuestionnaireForm(params)
if (res) {
this.setData({
finish: true
})
} else throw '提交失败'
console.log(res)
} catch (error) {
console.log(error)
if (error) wx.p.wxApi.showToast(error)
}
},
getNickNameAndHeadUrl() {
const redirectUrl = `https://scrm.glsx.com.cn/wy-wx-oauth`,
appid = 'wx1cf40dc91c28a7fd',
wxUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(redirectUrl)}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
wx.p.router.jumpH5(wxUrl)
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
const {
options
} = this
if (options.id) this.getQuestionnaireDetail(options)
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
},
// 添加埋点信息
addTrackInfo(){
const {userInfo} = this.data
let item = {
add_way: '104',
customer_phone: userInfo.phone
}
if (userInfo.nickName) {
item.customer_qw_nickname = userInfo.nickName
}
if (userInfo.headImgUrl) {
item.avatar = userInfo.headImgUrl
}
if (userInfo.unionId) {
item.union_id = userInfo.unionId
}
let json = JSON.stringify(item)
// 数据上报
wx.p.api.common.trackHttp({ json }).then(response => { })
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"gl-radio": "./components/Radio/Radio",
"gl-checkbox": "./components/Checkbox/Checkbox",
"gl-select": "./components/Select/Select",
"gl-cascader": "./components/Cascader/Cascader",
"van-field": "@vant/weapp/field/index",
"finish": "./components/Finish/Finish",
"gl-textarea": "/components/GlTextarea/GlTextarea"
}
}
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/questionnaire/questionnaire.wxss */
.layout {
// padding: 30rpx 40rpx calc(198rpx + var(--constantSafeAreaInsetBottom)) 0;
// padding: 30rpx 40rpx calc(198rpx + var(--envSafeAreaInsetBottom)) 0;
padding: 30rpx 40rpx 44rpx 0;
padding: 30rpx 40rpx 44rpx 0;
background-color: #fff;
min-height: 75vh;
.tips {
font-size: 28rpx;
color: #999999;
line-height: 40rpx;
display: block;
padding-left: 40rpx;
}
.form-box {
margin-top: 28rpx;
&::before {
content: '';
width: calc(100% - 40rpx);
height: 0;
margin-left: 40rpx;
display: block;
border-top: 2rpx dotted #e6e6e6;
}
.title {
padding: 40rpx 0 30rpx;
font-weight: 600;
font-size: 32rpx;
color: #333333;
letter-spacing: 0;
line-height: 48rpx;
display: flex;
justify-content: flex-end;
.num {
flex-shrink: 0;
padding-right: 10rpx;
}
.text {
width: calc(100% - 100rpx);
}
}
.required {
.num {
position: relative;
&::before {
position: absolute;
left: -16rpx;
top: 6rpx;
content: '*';
color: #F24724;
font-weight: normal;
}
}
}
.item {
width: calc(100% - 100rpx);
margin: 0 0 20rpx 100rpx;
}
.textarea {
height: 240rpx;
background: #FFFFFF;
border: 2rpx solid #E6E6E6;
border-radius: 8rpx;
box-sizing: border-box;
padding: 20rpx;
}
}
}
.fixed-btn {
// position: fixed;
// bottom: 0;
// left: 0;
width: calc(100% - 60rpx);
background-color: #F8F8F8;
padding: 32rpx 30rpx calc(32rpx + var(--constantSafeAreaInsetBottom));
padding: 32rpx 30rpx calc(32rpx + var(--envSafeAreaInsetBottom));
.default-btn {
width: 100%;
border-radius: 48rpx;
background-color: var(--themeColor);
}
}
.van-cell {
padding: 0 !important;
height: 100%;
overflow-y: scroll;
}
.van-field__body--textarea,.van-field__control{
height: 100% !important;
}
\ No newline at end of file \ No newline at end of file
<block wx:if="{{questionnaireObj.id}}">
<block wx:if="{{!finish}}">
<view class="layout">
<text class="tips">{{questionnaireObj.desc}}</text>
<view class="form-box">
<block wx:for="{{questionnaireObj.questions}}" wx:key="index">
<view class="title {{item.required?'required':''}}">
<view class="num">{{item.num}}.</view>
<view class="text">{{item.text}}</view>
</view>
<view class="item {{item.type == 3?'textarea':''}}">
<block wx:if="{{item.type == 1}}">
<gl-radio data="{{item.data}}" num="{{item.num}}" bindchange="change" />
</block>
<block wx:elif="{{item.type == 2}}">
<gl-checkbox data="{{item.data}}" num="{{item.num}}" bindchange="change" />
</block>
<block wx:elif="{{item.type == 3}}">
<gl-textarea placeholder="请输入" maxlength="{{item.maxLength}}" data-num="{{item.num}}" bindblur="blur" showWordLimit></gl-textarea>
</block>
<block wx:elif="{{item.type == 4}}">
<gl-select data="{{item.data}}" title="{{item.text}}" num="{{item.num}}" bindchange="change" />
</block>
<block wx:else>
<gl-cascader data="{{item.data}}" title="{{item.text}}" num="{{item.num}}" bindchange="change" />
</block>
</view>
</block>
</view>
</view>
<view class="fixed-btn text-center">
<button class="default-btn" bindtap="submit">提交</button>
</view>
</block>
<block wx:else>
<finish data="{{questionnaireObj}}" />
</block>
</block>
\ No newline at end of file \ No newline at end of file
...@@ -22,7 +22,6 @@ Page({ ...@@ -22,7 +22,6 @@ Page({
item_type: 6, item_type: 6,
view: 1 view: 1
}) })
this
}, },
......
...@@ -15,26 +15,42 @@ Page({ ...@@ -15,26 +15,42 @@ Page({
async onLoad(options) { async onLoad(options) {
const info = JSON.parse(decodeURIComponent(options.userProfile)) const info = JSON.parse(decodeURIComponent(options.userProfile))
const res = await USERAPI.updateUserInfo({ const res = await USERAPI.updateUserInfo({
nickName: info.nickName, nickName: info.nickName,
avatarUrl: info.avatarUrl avatarUrl: info.avatarUrl
}) }),
/**重新获取sessionId */
{
code,
data,
} = await wx.p.api.userApi.login()
if (data && code == '0') {
wx.p.storage.set('merchant_info', {
merchantId: data.merchantId,
merchantName: data.merchantName
})
wx.p.storage.set('userInfo', data)
wx.p.storage.set('sessionId', data.sessionId)
}
wx.p.router.back(res => { wx.p.router.back(res => {
res.setData({ res.setData({
nickName: info.nickName, nickName: info.nickName,
headImgUrl: info.avatarUrl, headImgUrl: info.avatarUrl,
hasUserInfo: true hasUserInfo: true
}) })
res.toCheckMember() res.toCheckMember && res.toCheckMember()
let item = { let item = {
add_way: '104', add_way: '104',
customer_phone: res.data.userInfo.phone, customer_phone: res.data.userInfo.phone,
customer_name: info.nickName, customer_qw_nickname: info.nickName,
avatar: info.avatarUrl, avatar: info.avatarUrl,
merchant_id: res.data.merchantId merchant_id: res.data.merchantId,
union_id: res.data.userInfo.unionId
} }
let json = JSON.stringify(item) let json = JSON.stringify(item)
// 数据上报 // 数据上报
wx.p.api.common.trackHttp({ json }).then(response => { }) wx.p.api.common.trackHttp({
json
}).then(response => {})
}) })
}, },
......
...@@ -31,6 +31,8 @@ Page({ ...@@ -31,6 +31,8 @@ Page({
wx.p.storage.set('merchant_info', { wx.p.storage.set('merchant_info', {
merchantId: options.merchantId, merchantId: options.merchantId,
}) })
wx.p.storage.set('first_enter_merchantId', options.merchantId)
wx.p.storage.set('first_enter_miniprograme', true)
} }
try { try {
const { code, data, message } = await wx.p.api.userApi.login() const { code, data, message } = await wx.p.api.userApi.login()
......
...@@ -29,6 +29,7 @@ Page({ ...@@ -29,6 +29,7 @@ Page({
wx.p.cache.storageApi.setSessionId(sid) wx.p.cache.storageApi.setSessionId(sid)
this.handleFreeCard(bingInfo) this.handleFreeCard(bingInfo)
} }
this.shareTitle = "省钱专区"
}, },
navbarReady(e) { navbarReady(e) {
...@@ -43,6 +44,10 @@ Page({ ...@@ -43,6 +44,10 @@ Page({
onShow() { onShow() {
let authComponent = this.selectComponent('#authorize') let authComponent = this.selectComponent('#authorize')
if (authComponent) authComponent.check() if (authComponent) authComponent.check()
const FIRST = wx.p.storage.get('first_enter_miniprograme')
this.setData({
showStore:!FIRST
})
}, },
goMorePage() { goMorePage() {
...@@ -316,4 +321,5 @@ Page({ ...@@ -316,4 +321,5 @@ Page({
notIntercept: true notIntercept: true
}) })
}, },
onShareAppMessage(){}
}) })
\ No newline at end of file \ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
</view> </view>
<!-- <view class="save-money-box"> --> <!-- <view class="save-money-box"> -->
<view class="save-money-box-content" style="{{user_box_style}}"> <view class="save-money-box-content" style="{{user_box_style}}">
<glsx-image webp src="home/homelife_bg.png" class="save-money-img"></glsx-image> <glsx-image webp src="home/save_money_bg.png" class="save-money-img"></glsx-image>
<view class="save-money-order-box"> <view class="save-money-order-box">
<glsx-image webp src="savemoney/save_order.png" class="save-money-order-img" bind:tap="toPluginPage"></glsx-image> <glsx-image webp src="savemoney/save_order.png" class="save-money-order-img" bind:tap="toPluginPage"></glsx-image>
<view bind:tap="toPluginPage" class="save-money-order-text-box">去下单</view> <view bind:tap="toPluginPage" class="save-money-order-text-box">去下单</view>
...@@ -41,4 +41,4 @@ ...@@ -41,4 +41,4 @@
</view> </view>
<!-- </view> --> <!-- </view> -->
<authorize id="authorize" scopeType="userLocation" isShowCheck="{{false}}" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize> <authorize id="authorize" scopeType="userLocation" isShowCheck="{{false}}" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize>
<!-- <glsx-privacy appletName="业主甄选"></glsx-privacy> -->
\ No newline at end of file \ No newline at end of file
<store-select show="{{showStore}}"></store-select>
\ No newline at end of file \ No newline at end of file
const navStyle = "background-color: transparent;"; const navStyle = "background-color: transparent;";
import { IMG_URL } from '~/config'; import { IMG_URL } from '~/config';
import { env } from '~/api/env/index' import { env } from '~/api/env/index'
import { MERCHANT_STATIC_LIST} from '~/utils/constants'
Page({ Page({
data: { data: {
IMG_URL, IMG_URL,
...@@ -29,7 +30,7 @@ Page({ ...@@ -29,7 +30,7 @@ Page({
let { height } = e.detail; let { height } = e.detail;
this.setData({ this.setData({
navBarHeight: height, navBarHeight: height,
user_box_style: `padding-top:${height+10}px`, user_box_style: `padding-top:${height + 10}px`,
}); });
}, },
// 处理滚动事件 // 处理滚动事件
...@@ -41,7 +42,14 @@ Page({ ...@@ -41,7 +42,14 @@ Page({
}, },
onLoad(options) { onLoad(options) {
this.defaultMerchant = wx.$merchant_id this.defaultMerchant = wx.$merchant_id
this.getMerchantList() const FIRST = wx.p.storage.get('first_enter_miniprograme')
if (FIRST) {
this.getMerchantList()
} else {
wx.p.eventbus.on('STORE', () => {
this.getMerchantList()
})
}
this.getStrategyList(); this.getStrategyList();
if (options?.jumpH5Url) { if (options?.jumpH5Url) {
this.setData({ this.setData({
...@@ -54,6 +62,7 @@ Page({ ...@@ -54,6 +62,7 @@ Page({
}) })
}, 1600) }, 1600)
} }
this.shareTitle = "甄选福利"
}, },
// 获取省钱攻略 // 获取省钱攻略
...@@ -81,7 +90,7 @@ Page({ ...@@ -81,7 +90,7 @@ Page({
toShowQrCode(e) { toShowQrCode(e) {
const { url } = e.currentTarget.dataset; const { url } = e.currentTarget.dataset;
const {currentStore} = this.data const { currentStore } = this.data
const Name = `${currentStore.merchantId}_${url}` const Name = `${currentStore.merchantId}_${url}`
this.setData({ this.setData({
urlName: Name, urlName: Name,
...@@ -110,78 +119,90 @@ Page({ ...@@ -110,78 +119,90 @@ Page({
wx.p.storage.set('merchant_info', { wx.p.storage.set('merchant_info', {
merchantId: currentStore.merchantId, merchantId: currentStore.merchantId,
}) })
wx.p.eventbus.emit('MALL_FRESH')
this.setData({ this.setData({
currentStore currentStore
},()=>{
this.getMerchantIdDetail(currentStore.merchantId)
}) })
}, },
// 获取门店列表 // 获取门店列表
getMerchantList() { async getMerchantList() {
const merchantObj = { const HAVE_ENTER = wx.p.storage.get('first_enter_miniprograme')
'develop': [44211227, 44209845], if (HAVE_ENTER && !this.fresh) {
'test': [44212577, 44210895, 44212578, 44210956], this.defaultMerchant = wx.p.storage.get('first_enter_merchantId')
'beta': [44211427,44211428],
'production': [44209566, 44209565],
} }
// 获取mock配置门店 // 获取mock配置门店
const MOCKDATA = wx.p.storage.get("mock_data"); const MOCKDATA = wx.p.storage.get("mock_data");
let MerchantList = merchantObj[env] let MerchantList = MERCHANT_STATIC_LIST[env]
if(MOCKDATA&&MOCKDATA.add_wuye_merchant){ if (MOCKDATA && MOCKDATA.add_wuye_merchant) {
const ADD_MERCHANT_LIST = MOCKDATA.add_wuye_merchant[env] const ADD_MERCHANT_LIST = MOCKDATA.add_wuye_merchant[env]
if(ADD_MERCHANT_LIST&&ADD_MERCHANT_LIST.length){ if (ADD_MERCHANT_LIST && ADD_MERCHANT_LIST.length) {
MerchantList = [...MerchantList,...ADD_MERCHANT_LIST] MerchantList = [...MerchantList, ...ADD_MERCHANT_LIST]
} }
} }
let storeList = [], index = 0 let storeList = [], index = 0
MerchantList.forEach((el, i) => { storeList = await this.getMerchantListData(MerchantList) || []
wx.$merchant_id = el storeList.forEach((ele, i) => {
wx.p.storage.set('merchant_info', { ele.merchantId = ele.merchantNo
merchantId: el, if (this.defaultMerchant == ele.merchantId) {
}) index = i
wx.p.api.homeApi.getHomeConfig({ merchantId: el }).then(data => { }
let { })
merchantName, const currentStore = storeList[index]
noticeContent wx.$merchant_id = currentStore.merchantId
} = data wx.p.storage.set('merchant_info', {
let bannerList = [] merchantId: currentStore.merchantId,
if (data.bannerList && data.bannerList.length) bannerList = data.bannerList })
storeList.push({ this.setData({
merchantName, storeList,
noticeContent, currentStore
bannerList, }, () => {
merchantId: el this.getMerchantIdDetail(currentStore.merchantId)
})
if (storeList.length > 1) {
storeList.forEach((ele, i) => {
if (this.defaultMerchant == ele.merchantId) {
index = i
}
})
const currentStore = storeList[index]
wx.$merchant_id = currentStore.merchantId
wx.p.storage.set('merchant_info', {
merchantId: currentStore.merchantId,
})
this.setData({
storeList,
currentStore
})
if( this.fresh){
wx.stopPullDownRefresh()
}
}
})
}) })
}, },
onPullDownRefresh(){ onPullDownRefresh() {
this.fresh = true this.fresh = true
this.defaultMerchant = this.getStorageMerchantId()
this.getMerchantList()
this.getStrategyList();
},
onShow() {
const FIRST = wx.p.storage.get('first_enter_miniprograme')
this.setData({
showStore: !FIRST
})
},
// 获取门店id
getStorageMerchantId() {
const { const {
merchantId merchantId
} = wx.p.storage.get('merchant_info') } = wx.p.storage.get('merchant_info')
this.defaultMerchant = merchantId return merchantId
this.getMerchantList() },
this.getStrategyList(); // 获取门店列表
} async getMerchantListData(merchantIdList) {
const res = await wx.p.api.shopmallApi.getStoreList({ merchantIdList })
if(res.code==0) return res.data
else return false
},
// 获取选择门店的信息
getMerchantIdDetail(merchantId) {
wx.$merchant_id = merchantId
wx.p.api.homeApi.getHomeConfig({ merchantId }).then(data => {
let {
noticeContent
} = data
let bannerList = [], { currentStore } = this.data
if (data.bannerList && data.bannerList.length) bannerList = data.bannerList
currentStore.noticeContent = noticeContent
currentStore.bannerList = bannerList
this.setData({
currentStore
})
})
},
onShareAppMessage(){}
}); });
...@@ -61,4 +61,4 @@ ...@@ -61,4 +61,4 @@
<image bind:tap="closeModal" class="close_icon" src="{{IMG_URL}}home/close_modal.png" /> <image bind:tap="closeModal" class="close_icon" src="{{IMG_URL}}home/close_modal.png" />
</view> </view>
</view> </view>
<!-- <glsx-privacy appletName="业主甄选"></glsx-privacy> -->
\ No newline at end of file \ No newline at end of file
<store-select show="{{showStore}}" bind:freshMerchant="freshMerchant"></store-select>
\ No newline at end of file \ No newline at end of file
...@@ -14,23 +14,23 @@ Component({ ...@@ -14,23 +14,23 @@ Component({
*/ */
properties: { properties: {
height: null, height: null,
channelID: { // channelID: {
type: Number, // type: Number,
observer: function (val) { // observer: function (val) {
if (val) { // if (val) {
// this.setList(val); // // this.setList(val);
} // }
}, // },
}, // },
merchantid: { // merchantid: {
type: [String, Number], // type: [String, Number],
observer: function (val) { // observer: function (val) {
if (val) { // if (val) {
this.init() // this.init()
// this.setList(val); // // this.setList(val);
} // }
}, // },
}, // },
}, },
/** /**
...@@ -66,8 +66,11 @@ Component({ ...@@ -66,8 +66,11 @@ Component({
toSeri: `toCategory-${index}`, toSeri: `toCategory-${index}`,
categoryStyle: item.categoryStyle || 0 categoryStyle: item.categoryStyle || 0
}) })
this.triggerEvent('showShoppingCar', item.categoryStyle) // this.triggerEvent('showShoppingCar', item.categoryStyle)
this.getCategoryGoodsList(item.id) const {
merchantId
} = wx.p.storage.get('merchant_info')
this.getCategoryGoodsList(item.id, merchantId)
}, },
//获取分类 //获取分类
getCategoryList() { getCategoryList() {
...@@ -84,17 +87,18 @@ Component({ ...@@ -84,17 +87,18 @@ Component({
categoryList: res, categoryList: res,
categoryStyle: res[0].categoryStyle || 0 categoryStyle: res[0].categoryStyle || 0
}) })
this.triggerEvent('showShoppingCar', res[0].categoryStyle) this.getCategoryGoodsList(res[0].id, merchantId)
// console.log(res[0].id,'res[0].id'); } else {
this.getCategoryGoodsList(res[0].id) this.setData({
categoryList: [],
categoryStyle: 0,
goodsList: []
})
} }
}) })
}, },
//获取商品列表 //获取商品列表
async getCategoryGoodsList(categoryId) { async getCategoryGoodsList(categoryId, merchantId) {
const {
merchantId
} = wx.p.storage.get('merchant_info')
let _para = { let _para = {
merchantId, merchantId,
categoryId, categoryId,
...@@ -157,6 +161,7 @@ Component({ ...@@ -157,6 +161,7 @@ Component({
item item
} = e.currentTarget.dataset } = e.currentTarget.dataset
const B_userInfo = wx.p.storage.get('userInfo') const B_userInfo = wx.p.storage.get('userInfo')
this.jumpEvent = true
if (B_userInfo && B_userInfo.userType) { if (B_userInfo && B_userInfo.userType) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/Login/Login' url: '/pages/Login/Login'
...@@ -212,20 +217,20 @@ Component({ ...@@ -212,20 +217,20 @@ Component({
// }); // });
// }, // },
// 获取购物车列表 // 获取购物车列表
async getBuyCarList() { // async getBuyCarList() {
const authStatus = await wx.p.router.intercept(false) // const authStatus = await wx.p.router.intercept(false)
if (authStatus) return // if (authStatus) return
const B_userInfo = wx.p.storage.get('userInfo') // const B_userInfo = wx.p.storage.get('userInfo')
if (B_userInfo && B_userInfo.userType) return; // if (B_userInfo && B_userInfo.userType) return;
const { // const {
merchantId // merchantId
} = wx.p.storage.get('merchant_info') // } = wx.p.storage.get('merchant_info')
const res = await shopmallApi.getShoppingcartList({ // const res = await shopmallApi.getShoppingcartList({
cartType: 4, // cartType: 4,
merchantId // merchantId
}) // })
eventbus.emit('getBuyCarList', res) // eventbus.emit('getBuyCarList', res)
}, // },
// 加入购物车 // 加入购物车
async toAddBuuCar(e) { async toAddBuuCar(e) {
const { const {
...@@ -233,6 +238,7 @@ Component({ ...@@ -233,6 +238,7 @@ Component({
} = e.currentTarget.dataset } = e.currentTarget.dataset
const authStatus = await wx.p.router.intercept() const authStatus = await wx.p.router.intercept()
if (authStatus) return if (authStatus) return
this.jumpEvent = true
if (this.data.hasCarOwnerCouponFlag) { if (this.data.hasCarOwnerCouponFlag) {
wx.p.router.go(`/packageMall/pages/getCoupon/getCoupon?discoverGoodsType=2&from=2`, { notIntercept: true }); wx.p.router.go(`/packageMall/pages/getCoupon/getCoupon?discoverGoodsType=2&from=2`, { notIntercept: true });
return return
...@@ -244,12 +250,12 @@ Component({ ...@@ -244,12 +250,12 @@ Component({
goodsId: item.id, goodsId: item.id,
} }
let _para = { let _para = {
goodsList:deliveryType==1? goodsListItem:[goodsListItem], goodsList: [goodsListItem],
isCarOwner: true, isCarOwner: true,
showAddr: deliveryType==0?1:0, showAddr: deliveryType == 0 ? 1 : 0,
buyType: 'pay', buyType: 'pay',
discoverGoodsSource: item.discoverGoodsSource, discoverGoodsSource: item.discoverGoodsSource,
deliveryType:deliveryType deliveryType: 0
} }
wx.p.router.go('/packageDiscovery/pages/pay/index', _para) wx.p.router.go('/packageDiscovery/pages/pay/index', _para)
// const res = await shopmallApi.addShoppingcart(_para) // const res = await shopmallApi.addShoppingcart(_para)
...@@ -275,7 +281,9 @@ Component({ ...@@ -275,7 +281,9 @@ Component({
this.init() this.init()
}, },
init() { init() {
this.getCategoryList() if (!this.jumpEvent) {
this.getCategoryList()
}
// const B_userInfo = wx.p.storage.get('userInfo') // const B_userInfo = wx.p.storage.get('userInfo')
// if (B_userInfo && B_userInfo.userType) return // if (B_userInfo && B_userInfo.userType) return
// this.getBuyCarList() // this.getBuyCarList()
...@@ -284,7 +292,14 @@ Component({ ...@@ -284,7 +292,14 @@ Component({
}, },
lifetimes: { lifetimes: {
ready: function () { ready: function () {
// this.init() wx.p.eventbus.on('MALL_FRESH', () => {
this.getCategoryList()
this.setData({
curCategoryIdx:0,
curPlayIdx:0,
toCategory: 'toCategory-0',
})
})
} }
} }
}) })
...@@ -82,7 +82,7 @@ page { ...@@ -82,7 +82,7 @@ page {
.titleBg { .titleBg {
box-sizing: border-box; box-sizing: border-box;
width: 750rpx; width: 722rpx;
height: 160rpx; height: 160rpx;
margin-left: -20rpx; margin-left: -20rpx;
background-image: url(https://img02.glsx.com.cn/weapp/resource/miniprogram/wuye/mall/goodsBg.png); background-image: url(https://img02.glsx.com.cn/weapp/resource/miniprogram/wuye/mall/goodsBg.png);
......
...@@ -7,90 +7,92 @@ Page({ ...@@ -7,90 +7,92 @@ Page({
} }
}, },
onShow() { onShow() {
let { // let {
merchantId // merchantId
} = this.data // } = this.data
const merchantInfo = wx.p.storage.get('merchant_info') // const merchantInfo = wx.p.storage.get('merchant_info')
let newMerchantId = merchantInfo.merchantId // let newMerchantId = merchantInfo.merchantId
if (newMerchantId != merchantId && newMerchantId ) { // if (newMerchantId != merchantId && newMerchantId ) {
this.setData({ // this.setData({
merchantId: newMerchantId // merchantId: newMerchantId
}) // })
this.getDiscoverInfo(newMerchantId, 6) // this.getDiscoverInfo(newMerchantId, 6)
} // }
// this.getDiscoverInfo(merchantInfo.merchantId, 6)
this.getComponentPage().onShow && this.getComponentPage().onShow() this.getComponentPage().onShow && this.getComponentPage().onShow()
}, const FIRST = wx.p.storage.get('first_enter_miniprograme')
getDiscoverInfo(merchantId, channel) {
discoveryApi.getDiscoverConfig({
merchantId
}).then(res => {
if (res && res.length) {
// console.log(JSON.stringify(res), channel);
this.handlerDiscoverSetting(JSON.stringify(res), channel)
}
})
},
// 处理发现配置数据
handlerDiscoverSetting(query, channel) {
const list = JSON.parse(query)
let {
currentChannel,
curTabIndex
} = this.data
if (list && list.length) {
if (channel) {
list.forEach((el, index) => {
if (el.channelType == channel) {
curTabIndex = index
currentChannel = el
}
})
} else {
currentChannel = list[0]
}
// this.computeBannerHeight(list.length)
}
this.setData({ this.setData({
discoverSettingList: list, showStore:!FIRST
showPage: true,
currentChannel,
curTabIndex
}) })
}, },
// getDiscoverInfo(merchantId, channel) {
// discoveryApi.getDiscoverConfig({
// merchantId
// }).then(res => {
// if (res && res.length) {
// // console.log(JSON.stringify(res), channel);
// this.handlerDiscoverSetting(JSON.stringify(res), channel)
// }
// })
// },
// 处理发现配置数据
// handlerDiscoverSetting(query, channel) {
// const list = JSON.parse(query)
// let {
// currentChannel,
// curTabIndex
// } = this.data
// if (list && list.length) {
// if (channel) {
// list.forEach((el, index) => {
// if (el.channelType == channel) {
// curTabIndex = index
// currentChannel = el
// }
// })
// } else {
// currentChannel = list[0]
// }
// // this.computeBannerHeight(list.length)
// }
// this.setData({
// currentChannel,
// })
// },
// 计算高度 // 计算高度
computeBannerHeight(len) { // computeBannerHeight(len) {
let query = wx.createSelectorQuery().in(this) // let query = wx.createSelectorQuery().in(this)
query // query
.select('.banner_wrapper') // .select('.banner_wrapper')
.boundingClientRect(res => { // .boundingClientRect(res => {
this.setData({ // this.setData({
'heightInfo.bannerH': res.height // 'heightInfo.bannerH': res.height
}) // })
}) // })
.exec() // .exec()
query // query
.select('.tab_wrapper') // .select('.tab_wrapper')
.boundingClientRect(react => { // .boundingClientRect(react => {
if (len == 1) { // if (len == 1) {
this.setData({ // this.setData({
'heightInfo.tabH': 20 // 'heightInfo.tabH': 20
}) // })
} else { // } else {
this.setData({ // this.setData({
'heightInfo.tabH': react.height // 'heightInfo.tabH': react.height
}) // })
} // }
}) // })
.exec() // .exec()
}, // },
//隐藏购物车 //隐藏购物车
showShoppingCarFn(e) { // showShoppingCarFn(e) {
this.setData({ // this.setData({
showCarFlag: e.detail != 2 // showCarFlag: e.detail != 2
}) // })
}, // },
navbarReady(e) { navbarReady(e) {
let { height } = e.detail; let { height } = e.detail;
this.setData({ this.setData({
...@@ -101,5 +103,11 @@ Page({ ...@@ -101,5 +103,11 @@ Page({
getComponentPage() { getComponentPage() {
return this.selectComponent(`#currentChannel_6`) return this.selectComponent(`#currentChannel_6`)
}, },
freshMerchant(){
this.onShow()
},
onShareAppMessage(){},
onLoad(){
this.shareTitle = "甄选专区"
}
}) })
\ No newline at end of file \ No newline at end of file
...@@ -9,4 +9,4 @@ ...@@ -9,4 +9,4 @@
</view> </view>
<carOwner id="currentChannel_6" bindshowShoppingCar="showShoppingCarFn" merchantid="{{merchantId}}" channelID="{{currentChannel.id}}"></carOwner> <carOwner id="currentChannel_6" bindshowShoppingCar="showShoppingCarFn" merchantid="{{merchantId}}" channelID="{{currentChannel.id}}"></carOwner>
</view> </view>
<!-- <glsx-privacy appletName="业主甄选"></glsx-privacy> -->
\ No newline at end of file \ No newline at end of file
<store-select show="{{showStore}}" bind:freshMerchant="freshMerchant"></store-select>
\ No newline at end of file \ No newline at end of file
...@@ -70,6 +70,7 @@ Page({ ...@@ -70,6 +70,7 @@ Page({
memberUrl: options.isOpenMember ? 'bg-member' : 'bg-member-first' memberUrl: options.isOpenMember ? 'bg-member' : 'bg-member-first'
}) })
} }
this.shareTitle = "我的"
}, },
navbarReady(e) { navbarReady(e) {
let { let {
...@@ -179,7 +180,14 @@ Page({ ...@@ -179,7 +180,14 @@ Page({
this.toCheckMember() this.toCheckMember()
this.getUserCarList() this.getUserCarList()
this.getMemberCardData() this.getMemberCardData()
const FIRST = wx.p.storage.get('first_enter_miniprograme')
this.setData({
showStore:!FIRST
})
}, },
freshMerchant(){
this.getMemberCardData()
},
onShareAppMessage(){}
}) })
\ No newline at end of file \ No newline at end of file
...@@ -159,4 +159,4 @@ ...@@ -159,4 +159,4 @@
<glsx-image bindtap="handleChangeVal" data-attr="isMemberShow" data-val="{{false}}" class="member-close" src="mine/icon-member-close.png"></glsx-image> <glsx-image bindtap="handleChangeVal" data-attr="isMemberShow" data-val="{{false}}" class="member-close" src="mine/icon-member-close.png"></glsx-image>
</view> </view>
</view> </view>
<!-- <glsx-privacy appletName="业主甄选"></glsx-privacy> -->
\ No newline at end of file \ No newline at end of file
<store-select show="{{showStore}}" bind:freshMerchant="freshMerchant"></store-select>
\ No newline at end of file \ No newline at end of file
...@@ -13,6 +13,7 @@ Page({ ...@@ -13,6 +13,7 @@ Page({
*/ */
onLoad(options) { onLoad(options) {
this.getStrategyList(); this.getStrategyList();
this.shareTitle = "攻略专区"
}, },
navbarReady(e) { navbarReady(e) {
...@@ -40,5 +41,12 @@ Page({ ...@@ -40,5 +41,12 @@ Page({
id, id,
notIntercept: true notIntercept: true
}) })
},
onShareAppMessage(){},
onShow(){
const FIRST = wx.p.storage.get('first_enter_miniprograme')
this.setData({
showStore:!FIRST
})
} }
}); });
...@@ -13,3 +13,4 @@ ...@@ -13,3 +13,4 @@
</view> </view>
</view> </view>
</view> </view>
<store-select show="{{showStore}}"></store-select>
\ No newline at end of file \ No newline at end of file
...@@ -167,4 +167,13 @@ ...@@ -167,4 +167,13 @@
100% { 100% {
opacity: 1; opacity: 1;
} }
}
/* van组件样式 */
.van-cascader__title{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.van-picker__confirm {
color: var(--themeColor) !important;
} }
\ No newline at end of file \ No newline at end of file
...@@ -18,10 +18,21 @@ export const STORAGE_OBJECTkEY = { ...@@ -18,10 +18,21 @@ export const STORAGE_OBJECTkEY = {
guest_no: 'guest_no', guest_no: 'guest_no',
scrm_shopmall_car_brand_list:"scrm_shopmall_car_brand_list", scrm_shopmall_car_brand_list:"scrm_shopmall_car_brand_list",
shareStaff:"shareStaff", shareStaff:"shareStaff",
miaoshatrack:'miaoshatrack' miaoshatrack:'miaoshatrack',
first_enter_miniprograme:"first_enter_miniprograme",
first_enter_merchantId:"first_enter_merchantId"
}
// 设置默认门店信息
export const MERCHANT_STATIC_LIST = {
'develop': [44211227, 44209845],
'test': [44212577, 44210895, 44212578, 44210956],
'beta': [44211427, 44211428],
'production': [44209566, 44209565],
} }
export default{ export default{
DEFAULT_GET_STORAGEKEY, DEFAULT_GET_STORAGEKEY,
STORAGE_OBJECTkEY STORAGE_OBJECTkEY,
MERCHANT_STATIC_LIST
} }
\ No newline at end of file \ No newline at end of file
...@@ -93,8 +93,8 @@ class Share { ...@@ -93,8 +93,8 @@ class Share {
} }
} }
getCommonData() { getCommonData() {
const WXUSERINFO = wx.p.storage.get('wx_user_info'), //针对没登录用户,有openid const WXUSERINFO = wx.p.storage.get('wx_user_info') || {}, //针对没登录用户,有openid
USERINFO = wx.p.storage.get('userInfo') //这个是针对登录的 USERINFO = wx.p.storage.get('userInfo') || {} //这个是针对登录的
const { const {
merchantId merchantId
} = wx.p.storage.get('merchant_info') } = wx.p.storage.get('merchant_info')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!