Browse Source

【3月版本迭代】

release
GL 4 years ago
parent
commit
54c228cbc9
15 changed files with 409 additions and 46 deletions
  1. +19
    -0
      app.js
  2. +19
    -3
      custom-tab-bar/index.js
  3. +3
    -3
      custom-tab-bar/index.wxss
  4. +15
    -24
      ext.json
  5. +105
    -1
      index/index.js
  6. +130
    -4
      index/user.js
  7. +1
    -1
      pages/canvas/index.js
  8. +77
    -1
      pages/coupon/detail/index.js
  9. +2
    -1
      pages/coupon/detail/index.json
  10. +4
    -0
      pages/coupon/detail/index.wxml
  11. +27
    -6
      pages/coupon/detail/index.wxss
  12. +4
    -0
      pages/getphoneInfo/index.js
  13. +1
    -0
      pages/getuserinfo/index.js
  14. +1
    -1
      pages/index/searchbar/detail/index.js
  15. +1
    -1
      project.config.json

+ 19
- 0
app.js View File

@@ -5,6 +5,23 @@ App({
data: {
newArr:[],//存放分享二维进入消息信息
},
// 这里这么写,是要在其他界面监听,而不是在app.js中监听,而且这个监听方法,需要一个回调方法。
watch: function (method) {
var obj = this.globalData;
Object.defineProperty(obj, "ifShowTab", {
configurable: true,
enumerable: true,
set: function (value) {
this._ifShowTab = value;
console.log('是否会被执行2')
method(value);
},
get: function () {
// 可以在这里打印一些东西,然后在其他界面调用getApp().globalData.name的时候,这里就会执行。
return this._ifShowTab
}
})
},
onLaunch: function(options) {
var that = this;
if (that.globalData.previewFlag) {//解决微信图片预览重复进入app.js onshow
@@ -164,6 +181,8 @@ App({
})
},
globalData: {
styleLsit:{},
ifShowTab: true,
previewFlag:false,//解决图片预览调用noshow
activityId:'',//活动id方便授权数据回传
typeLsit: [],//初始哈样式


+ 19
- 3
custom-tab-bar/index.js View File

@@ -94,16 +94,20 @@ Component({
// console.log(this.data.home_a_img)

const data = e.currentTarget.dataset;
this.setData({
selected: data.index
})
console.log(data.index)
const url = data.path;
if (data.index == 0 || data.index == 3) {
console.log("ifShowTab = false")
app.globalData.ifShowTab = false
this.getTemplateId()
}
wx.switchTab({
url
});
this.setData({
selected: data.index
})
},
/**
* 获取全局样式
@@ -118,6 +122,7 @@ Component({
data
} = res
if (code == 200) {
app.globalData.styleLsit = data
this.setData({
list: [{
"pagePath": "/index/index",
@@ -209,6 +214,7 @@ Component({
wx.requestSubscribeMessage({
tmplIds: tmplIds,
success(res) {
console.log("我重复订阅")
let _statue = null
tmplIds.map((item, index) => { //判读用户是否点击了确定
if (res[item] == "accept") {
@@ -219,15 +225,25 @@ Component({
Http.post({
url: config.api.wxMsg
}).then(res => {
app.globalData.ifShowTab = true
wx.setStorageSync({
key: 'ifShowTab',
data: true,
})
console.log(res)
})
return
}
app.globalData.ifShowTab = true
// for (let i = 0; i < tmplIds.length;i++){
// if (res.tmplIds[i] == 'accept'){
// console.log("发送")
// }
// }
},
complete(){
app.globalData.ifShowTab = true
}
})
},


+ 3
- 3
custom-tab-bar/index.wxss View File

@@ -4,7 +4,7 @@
left: 0;
right: 0;
height: 70rpx;
/* padding: 10rpx; */
padding: 10rpx;
background: white;
display: flex;
padding-bottom: env(safe-area-inset-bottom);
@@ -30,8 +30,8 @@
}

.tab-bar-item cover-image {
width: 44rpx;
height: 44rpx;
width: 46rpx;
height: 46rpx;
}

.tab-bar-item cover-view {


+ 15
- 24
ext.json View File

@@ -2,43 +2,33 @@
"ext": {
"attr": {
"car": {
"tjd": {
"payPath": "",
"tjdAppId": "wx6945d1bda68d7993"
},
"etcp": {
"payPath": "pages/pay/order-pay-open/main",
"etcpAppId": "wxc07f9d67923d676d",
"etcpCallbackUrl": "https://admin.malls.iformall.com/api/carCallback/etcpPaidCallback"
},
"bolink": {
"payPath": "pages/park/park",
"bolinkAppId": "wxbd08b4baa10fcc1d"
},
"version": "release"
"etcpAppId": "wx192b7d2e8dcbefd0",
"etcpVersion": "release",
"etcpCallbackUrl": "https://admintest.malls.iformall.com/api/carCallback/etcpPaidCallback"
}
},
"imgProxy": [
{
"newUrl": "https://c.malls.iformall.com/img",
"newUrl": "https://ctest.malls.iformall.com/img",
"orgUrl": "https://iformall-net.formall.oss-accelerate.aliyuncs.com"
},
{
"newUrl": "https://c.malls.iformall.com/img1",
"newUrl": "https://ctest.malls.iformall.com/img1",
"orgUrl": "https://formall.oss-accelerate.aliyuncs.com"
},
{
"newUrl": "https://c.malls.iformall.com/img2",
"newUrl": "https://ctest.malls.iformall.com/img2",
"orgUrl": "https://wx.qlogo.cn"
}
],
"configUrl": "https://c.malls.iformall.com/C/api",
"ifStoreApp": "0",
"configUrl": "https://ctest.malls.iformall.com/C/api",
"ifHaveWebSocket": "0",
"ifHaveCarModular": "0"
"ifHaveCarModular": "1"
},
"name": "富茂链客生产版",
"weappId": "wx6a2524a8286d687f",
"appVersion": "C.5.1.1"
"name": "金泸商务",
"weappId": "wx649b3be73c1afe47",
"appVersion": "C.test.5.2.0"
},
"debug": false,
"tabBar": {
@@ -68,7 +58,8 @@
"selectedIconPath": "assets/images/user-a.png"
}
],
"custom": true
"color": "#abb1be",
"selectedColor": "#b2743d"
},
"window": {
"backgroundTextStyle": "dark",
@@ -82,7 +73,7 @@
"provider": "wx2b03c6e691cd7370"
}
},
"extAppid": "wx6a2524a8286d687f",
"extAppid": "wx649b3be73c1afe47",
"extEnable": true,
"permission": {
"scope.userLocation": {


+ 105
- 1
index/index.js View File

@@ -259,6 +259,7 @@ Page({
* 生命周期函数--监听页面初次渲染完成
*/
onLoad: function(options) {
console.log("我只执行一次")
this.getType()
this.getLocation();
let that = this;
@@ -319,7 +320,110 @@ Page({
onUnload() {
// wx.removeStorageSync('squareList')
},
watchBack: function (ifShowTab) { //监听ifShowTab变化
if (ifShowTab){
this.getTabBar().setData({
list: [{
"pagePath": "/index/index",
"iconPath": `${app.globalData.styleLsit.t_in.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_in_std.icon}`,
"text": "首页"
},
{
"pagePath": "/index/searchbar",
"iconPath": `${app.globalData.styleLsit.t_md.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_md_std.icon}`,
"text": "门店"
},
{
"pagePath": "/index/passCar",
"iconPath": `${app.globalData.styleLsit.t_tc.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_tc_std.icon}`,
"text": "停车"
},
{
"pagePath": "/index/user",
"iconPath": `${app.globalData.styleLsit.t_uc.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_uc_std.icon}`,
"text": "我的"
}
],
})
}else{
console.log("我隐藏了")
this.getTabBar().setData({
list:[]
})
}
},
onShow: function() {
if (app.globalData.ifShowTab){
this.getTabBar().setData({
list: [{
"pagePath": "/index/index",
"iconPath": `${app.globalData.styleLsit.t_in.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_in_std.icon}`,
"text": "首页"
},
{
"pagePath": "/index/searchbar",
"iconPath": `${app.globalData.styleLsit.t_md.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_md_std.icon}`,
"text": "门店"
},
{
"pagePath": "/index/passCar",
"iconPath": `${app.globalData.styleLsit.t_tc.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_tc_std.icon}`,
"text": "停车"
},
{
"pagePath": "/index/user",
"iconPath": `${app.globalData.styleLsit.t_uc.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_uc_std.icon}`,
"text": "我的"
}
],
})
} else {
console.log("我隐藏")
this.getTabBar().setData({
list: []
})
}
if (wx.getStorageSync("tabFlag") && wx.getStorageSync("tabFlag")==1){//处理授权取消后回到首页底部导航栏显示
this.getTabBar().setData({
list: [{
"pagePath": "/index/index",
"iconPath": `${app.globalData.styleLsit.t_in.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_in_std.icon}`,
"text": "首页"
},
{
"pagePath": "/index/searchbar",
"iconPath": `${app.globalData.styleLsit.t_md.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_md_std.icon}`,
"text": "门店"
},
{
"pagePath": "/index/passCar",
"iconPath": `${app.globalData.styleLsit.t_tc.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_tc_std.icon}`,
"text": "停车"
},
{
"pagePath": "/index/user",
"iconPath": `${app.globalData.styleLsit.t_uc.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_uc_std.icon}`,
"text": "我的"
}
],
})
wx.removeStorageSync("tabFlag")
}
console.log("我每次都执行" ,app.globalData.ifShowTab)
app.watch(this.watchBack)
this.ifShowSqare();
if (wx.getStorageSync("squareList")) {
var temp = wx.getStorageSync("squareList").filter(item => item.tenantId == wx.getStorageSync("selectedMall"))[0].name
@@ -330,7 +434,7 @@ Page({
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
this.getTabBar().setData({
selected: 0
selected: 0,
})
}
let that = this;


+ 130
- 4
index/user.js View File

@@ -75,7 +75,7 @@ Page({
* 将值传到用户手机号授权的页面
*
*/
wx.redirectTo({
wx.navigateTo({
url: `/pages/getphoneInfo/index?path=main`
});
},
@@ -128,7 +128,67 @@ Page({
gotoedit: function() {
this.checkUserStatus();
},
watchBack: function (ifShowTab) { //监听ifShowTab变化
console.log("ifShowTab",ifShowTab)
if (ifShowTab) {
console.log("ifShowTab", ifShowTab)
this.getTabBar().setData({
list: [{
"pagePath": "/index/index",
"iconPath": `${app.globalData.styleLsit.t_in.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_in_std.icon}`,
"text": "首页"
},
{
"pagePath": "/index/searchbar",
"iconPath": `${app.globalData.styleLsit.t_md.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_md_std.icon}`,
"text": "门店"
},
{
"pagePath": "/index/passCar",
"iconPath": `${app.globalData.styleLsit.t_tc.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_tc_std.icon}`,
"text": "停车"
},
{
"pagePath": "/index/user",
"iconPath": `${app.globalData.styleLsit.t_uc.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_uc_std.icon}`,
"text": "我的"
}
],
})
} else {
console.log("我隐藏")
this.getTabBar().setData({
list: []
})
}
},
onLoad() {
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
if (ifStoreApp == 1) {
this.getTabBar().setData({
selected: 1
})
} else if (ifStoreApp == 2) {
this.getTabBar().setData({
selected: 2
})
} else {
this.getTabBar().setData({
selected: 3,
list: []
})
}

}



this.getLocation();
this.updateScene();
// this.getRoomId();
@@ -203,6 +263,42 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function() {
console.log(app.globalData.ifShowTab,"////")
if (app.globalData.ifShowTab){
this.getTabBar().setData({
list: [{
"pagePath": "/index/index",
"iconPath": `${app.globalData.styleLsit.t_in.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_in_std.icon}`,
"text": "首页"
},
{
"pagePath": "/index/searchbar",
"iconPath": `${app.globalData.styleLsit.t_md.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_md_std.icon}`,
"text": "门店"
},
{
"pagePath": "/index/passCar",
"iconPath": `${app.globalData.styleLsit.t_tc.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_tc_std.icon}`,
"text": "停车"
},
{
"pagePath": "/index/user",
"iconPath": `${app.globalData.styleLsit.t_uc.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_uc_std.icon}`,
"text": "我的"
}
],
})
} else {
console.log("我隐藏")
this.getTabBar().setData({
list: []
})
}
app.watch(this.watchBack)
let that = this;
that.userAuthorization()
if (typeof that.getTabBar === 'function' &&
@@ -217,10 +313,40 @@ Page({
})
} else {
that.getTabBar().setData({
selected: 3
selected: 3,
})
}

}
if (wx.getStorageSync("tabFlag") && wx.getStorageSync("tabFlag") == 1) {//处理授权取消后回到首页底部导航栏显示
this.getTabBar().setData({
list: [{
"pagePath": "/index/index",
"iconPath": `${app.globalData.styleLsit.t_in.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_in_std.icon}`,
"text": "首页"
},
{
"pagePath": "/index/searchbar",
"iconPath": `${app.globalData.styleLsit.t_md.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_md_std.icon}`,
"text": "门店"
},
{
"pagePath": "/index/passCar",
"iconPath": `${app.globalData.styleLsit.t_tc.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_tc_std.icon}`,
"text": "停车"
},
{
"pagePath": "/index/user",
"iconPath": `${app.globalData.styleLsit.t_uc.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_uc_std.icon}`,
"text": "我的"
}
],
})
wx.removeStorageSync("tabFlag")
}
that.setData({
appVersion: extConfig.appVersion,
@@ -286,7 +412,7 @@ Page({
score: res.data.score,
curPhone: curPhone,
levelName: res.data.levelName,
userId: res.data.id
userId: res.data.userId
})
if (res.data.nickName) {
that.setData({


+ 1
- 1
pages/canvas/index.js View File

@@ -348,7 +348,7 @@ Page({
pageNum: 1,
pageSize: 15
};
Http.get({
Http.post({
url: config.api.listByMerchant,
data: data
})


+ 77
- 1
pages/coupon/detail/index.js View File

@@ -25,6 +25,7 @@ Page({
swiperCurrent: 0,
detailPicture: [],
coverPicture: [],
couponList:[],
data: {
title: null
},
@@ -88,7 +89,8 @@ Page({
//图文混排
curHtml: '',
contentType: 0,

page:1,//查询商户优惠券page
idList:[],
},
/**
* 显示分享弹框
@@ -97,6 +99,58 @@ Page({
this.setData({
isshowposter: true,
})
},
getCouponList: function(id) {
let that = this;
let data;
data = {
status: 0,
merchantIds: id,
pageNum: that.data.page,
pageSize: 4,
}
Http.post({
url: config.api.listByMerchant,
data: data
}).then(res => {
if (res.data.page.list<=0){
return
}
let dataLsit = []
dataLsit = that.data.couponList
dataLsit.push(...res.data.page.list)
dataLsit.map((item,index)=>{
if (item.id == that.data.couponChannelId){
dataLsit.splice(index,1)
}
})
if (that.data.page>1){
let tmpeLsit = dataLsit
tmpeLsit.push(...res.data.page.list)
that.setData({
couponList: tmpeLsit,
})
}else{
that.setData({
couponList: dataLsit,
})
}
// if (res.data && res.data.qrCode){
// that.setData({
// qrCode: res.data.qrCode,
// })
// }
})
.catch(err => {
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
},
/**
* 隐藏分享弹框
@@ -450,6 +504,7 @@ Page({
})
if (options && options.couponChannelId) {
that.getDetail(options.couponChannelId, 'notendclock');

}
/**
* 转赠判断
@@ -498,6 +553,18 @@ Page({
};
Http.get(parmer)
.then(res => {
if (res.data.merchantVoList && res.data.merchantVoList.length){
let merchantVoList = res.data.merchantVoList
let idList = []
merchantVoList.map(item=>{
idList.push(item.id)
})
that.setData({
idList: idList
})
that.getCouponList(idList)
}
//aaa
if (res.data.contentType != undefined && res.data.contentType == 1) {
//获取图文展示详情html
@@ -1070,5 +1137,14 @@ Page({
onPullDownRefresh: function() {
this.getDetail(this.data.couponChannelId);
wx.stopPullDownRefresh()
},
onReachBottom:function(){
this.setData({
page:this.data.page+1
})
if (this.data.idList.length>0){
this.getCouponList(this.data.idList)
}
}
});

+ 2
- 1
pages/coupon/detail/index.json View File

@@ -2,7 +2,8 @@
"usingComponents": {
"c-shareposter": "../../../../components/shareposter/index",
"navbar": "../../../../components/navbar/navbar",
"store": "../../../../components/store/index"
"store": "../../../../components/store/index",
"c-coupons": "../../../components/coupons/index"
},
"navigationBarTitleText": "",
"backgroundColor":"#f4f4f4",


+ 4
- 0
pages/coupon/detail/index.wxml View File

@@ -129,6 +129,10 @@
<rich-text nodes="{{curHtml}}"></rich-text>
</view>
</view>
<view wx:if="{{couponList.length!=0}}" style="color: #333;letter-spacing: 0;font-size: 30rpx;height: 70rpx;line-height: 70rpx;margin-left: 35rpx;">其他活动</view>
<view class='couponsL clearfix'>
<c-coupons wx:if="{{couponList.length!=0}}" wx:for="{{couponList}}" from="fromMerchant" paramAtoB="{{loading}}" wx:key="unique" data="{{item}}" list="{{couponList}}" />
</view>
<view class='detailImg' wx:if="{{detailPicture.length>0}}">
<image wx:for="{{detailPicture}}" wx:key="{{index}}" wx:for-item="item" src='{{item}}' mode='widthFix'></image>
</view>


+ 27
- 6
pages/coupon/detail/index.wxss View File

@@ -16,6 +16,20 @@ button::after {
background: #f4f5f9;
}

.couponsL c-coupons {
width: 335rpx;
height: 354rpx;
margin-bottom: 22rpx;
}

.couponsL c-coupons:nth-of-type(2n+1) {
float: left;
}

.couponsL c-coupons:nth-of-type(2n) {
float: right;
}

.banner {
position: relative;
width: 750rpx;
@@ -59,16 +73,17 @@ button::after {
.pickFinal_Box {
overflow: hidden;
}
.earnestTime{

.earnestTime {
font-size: 28rpx;
color: #a6a6a6;

}
.finalTime{

.finalTime {
font-size: 28rpx;
color: #a6a6a6;

}

.original {
float: left;
width: 100rpx;
@@ -111,6 +126,11 @@ button::after {
margin-left: 14rpx;
}

.couponsL {
width: 92%;
margin: 20rpx auto;
}

.coupons_info {
width: 92%;
padding: 0 4%;
@@ -340,9 +360,10 @@ button::after {
line-height: 94rpx;
border-radius: 61rpx;
}
#noBuy{

#noBuy {
position: relative;
background-color:rgba(0, 0, 0, 0.2);
background-color: rgba(0, 0, 0, 0.2);
height: 94rpx;
width: 560rpx;
margin: 0 auto 30rpx;


+ 4
- 0
pages/getphoneInfo/index.js View File

@@ -67,11 +67,13 @@ Page({
})
},
backHome: function() {
wx.setStorageSync("tabFlag", 1)
wx.switchTab({
url: '/index/index',
})
},
getPhoneNumber: function(e) {
wx.setStorageSync("tabFlag", 1)
var that = this;
var iv = e.detail.iv;
var encryptedData = e.detail.encryptedData;
@@ -82,6 +84,7 @@ Page({
iv: iv
}
}).then(res => {
app.globalData.phone = res.data.phone;
if (that.data.skipUrl == '1') {
console.log(app.globalData.skip,app.globalData.skipUrl,"跳转地址" )
@@ -164,6 +167,7 @@ Page({
url: '/index/user'
});
} else {
wx.showToast({
title: res.data.msg,
icon: "success",


+ 1
- 0
pages/getuserinfo/index.js View File

@@ -136,6 +136,7 @@ Page({
})
},
backHome: function() {
wx.setStorageSync("tabFlag", 1)
wx.switchTab({
url: '/index/index',
})


+ 1
- 1
pages/index/searchbar/detail/index.js View File

@@ -194,7 +194,7 @@ Page({
pageNum: that.data.page,
pageSize: 15,
}
Http.get({
Http.post({
url: config.api.listByMerchant,
data: data
}).then(res => {


+ 1
- 1
project.config.json View File

@@ -32,7 +32,7 @@
},
"compileType": "miniprogram",
"libVersion": "2.9.5",
"appid": "wx453ae0d37f3550d0",
"appid": "wxfa336cad86ed598d",
"projectname": "oldC",
"isGameTourist": false,
"simulatorType": "wechat",


Loading…
Cancel
Save