| @@ -5,7 +5,6 @@ App({ | |||||
| data: {}, | data: {}, | ||||
| onLaunch: function (options) { | onLaunch: function (options) { | ||||
| var that = this; | var that = this; | ||||
| console.log("onLuanch") | |||||
| that.globalData.sceneAddress = options.scene; | that.globalData.sceneAddress = options.scene; | ||||
| /** | /** | ||||
| * 用户登录 | * 用户登录 | ||||
| @@ -99,21 +98,6 @@ App({ | |||||
| } | } | ||||
| }) | }) | ||||
| }, | }, | ||||
| /** | |||||
| * 获取地址位置信息 | |||||
| */ | |||||
| getLocation: function () { | |||||
| var that = this; | |||||
| wx.getLocation({ | |||||
| type: "wgs84", | |||||
| success: function (res) { | |||||
| that.globalData.locationInfo = res; | |||||
| }, | |||||
| fail: error => { | |||||
| console.log(error); | |||||
| } | |||||
| }); | |||||
| }, | |||||
| globalData: { | globalData: { | ||||
| // token | // token | ||||
| token: null, | token: null, | ||||
| @@ -134,7 +118,7 @@ App({ | |||||
| carLogin: false, | carLogin: false, | ||||
| // 当前商场信息 | // 当前商场信息 | ||||
| market: { | market: { | ||||
| name: "陕西大悦城" | |||||
| name: "" | |||||
| }, | }, | ||||
| // websocket | // websocket | ||||
| socketClient: null, | socketClient: null, | ||||
| @@ -281,7 +281,11 @@ var config = { | |||||
| /** | /** | ||||
| * 会员积分记录 | * 会员积分记录 | ||||
| */ | */ | ||||
| integralList:'/credit/list' | |||||
| integralList:'/credit/list', | |||||
| /** | |||||
| * 用户更新位置信息 | |||||
| */ | |||||
| updateLBS:"/user/updateLBS" | |||||
| }, | }, | ||||
| weapp: { | weapp: { | ||||
| AppId: weappId | AppId: weappId | ||||
| @@ -45,7 +45,6 @@ | |||||
| .merchant-detail { | .merchant-detail { | ||||
| width: 100%; | width: 100%; | ||||
| padding: 30rpx 0 0; | |||||
| background: #fff; | background: #fff; | ||||
| border-top-left-radius: 20rpx; | border-top-left-radius: 20rpx; | ||||
| border-top-right-radius: 20rpx; | border-top-right-radius: 20rpx; | ||||
| @@ -145,23 +145,23 @@ Page({ | |||||
| appId: config.weapp.AppId, | appId: config.weapp.AppId, | ||||
| } | } | ||||
| }) | }) | ||||
| .then(res => { | |||||
| let weapNote = JSON.parse(res.data.weapNote); | |||||
| that.setData({ | |||||
| desc: weapNote.carpage.desc, | |||||
| title: weapNote.carpage.title | |||||
| }) | |||||
| }) | |||||
| .catch(err => { | |||||
| console.log(err); | |||||
| .then(res => { | |||||
| let weapNote = JSON.parse(res.data.weapNote); | |||||
| that.setData({ | |||||
| desc: weapNote.carpage.desc, | |||||
| title: weapNote.carpage.title | |||||
| }) | }) | ||||
| }) | |||||
| .catch(err => { | |||||
| console.log(err); | |||||
| }) | |||||
| // 登录 | // 登录 | ||||
| var scene = decodeURIComponent(options.scene); | var scene = decodeURIComponent(options.scene); | ||||
| that.setData({ | that.setData({ | ||||
| scene: scene | scene: scene | ||||
| }); | }); | ||||
| if (app.globalData.token) { } else { | if (app.globalData.token) { } else { | ||||
| app.getLocation(); | |||||
| // app.getLocation(); | |||||
| that.userLogin() | that.userLogin() | ||||
| } | } | ||||
| }, | }, | ||||
| @@ -19,7 +19,11 @@ | |||||
| <text style='display:inline-block;'>{{item.discount/10}}</text>折</view> | <text style='display:inline-block;'>{{item.discount/10}}</text>折</view> | ||||
| <text class='tit'>{{item.merchantName}}</text> | <text class='tit'>{{item.merchantName}}</text> | ||||
| <view class='clearfix footer'> | <view class='clearfix footer'> | ||||
| <text class='fl'>{{item.buildingName}}{{item.floorName}}</text> | |||||
| <view class='fl' style='margin-top:-30rpx;margin-left:10rpx;'> | |||||
| <view class='building' wx:for="{{item.shopVoList}}" wx:key="{{index}}" wx:for-item="list"> | |||||
| {{list.buildingName}}{{list.floorName}} | |||||
| </view> | |||||
| </view> | |||||
| <view class='fr' bindtap='phone' data-merchantLinkPhone='{{item.merchantLinkPhone}}'> | <view class='fr' bindtap='phone' data-merchantLinkPhone='{{item.merchantLinkPhone}}'> | ||||
| <image class="fr" src='{{teliconUrl}}' mode='widthFix'></image> | <image class="fr" src='{{teliconUrl}}' mode='widthFix'></image> | ||||
| </view> | </view> | ||||
| @@ -1,125 +1,151 @@ | |||||
| @import "../../app.wxss"; | @import "../../app.wxss"; | ||||
| Page{ | |||||
| Page { | |||||
| background: #fc5b24; | background: #fc5b24; | ||||
| } | } | ||||
| .none{ | |||||
| .none { | |||||
| font-size: 28rpx; | font-size: 28rpx; | ||||
| text-align: center; | text-align: center; | ||||
| margin-top: 30rpx; | margin-top: 30rpx; | ||||
| color: #fff; | |||||
| float:none!important; | |||||
| color: #fff; | |||||
| float: none !important; | |||||
| } | } | ||||
| .headerbg image{ | |||||
| .headerbg image { | |||||
| display: block; | display: block; | ||||
| width: 100%; | width: 100%; | ||||
| } | } | ||||
| .fl{ | |||||
| .fl { | |||||
| float: left; | float: left; | ||||
| } | } | ||||
| .fr{ | |||||
| .fr { | |||||
| float: right; | float: right; | ||||
| } | } | ||||
| .title{ | |||||
| .title { | |||||
| padding: 20rpx 40rpx 30rpx; | padding: 20rpx 40rpx 30rpx; | ||||
| color: #fff; | color: #fff; | ||||
| text-align: center; | text-align: center; | ||||
| font-size:26rpx; | |||||
| font-size: 26rpx; | |||||
| } | } | ||||
| .card{ | |||||
| .card { | |||||
| position: relative; | position: relative; | ||||
| width: 335rpx; | width: 335rpx; | ||||
| margin: 0 auto 18rpx; | margin: 0 auto 18rpx; | ||||
| border-radius:16rpx; | |||||
| border-radius: 16rpx; | |||||
| overflow: hidden; | overflow: hidden; | ||||
| padding-bottom: 20rpx; | padding-bottom: 20rpx; | ||||
| background: #fff; | |||||
| background: #fff; | |||||
| height: 185rpx; | height: 185rpx; | ||||
| } | } | ||||
| .txt01 text{ | |||||
| .txt01 text { | |||||
| display: block; | display: block; | ||||
| text-align: center; | text-align: center; | ||||
| } | } | ||||
| .cards{ | |||||
| .cards { | |||||
| padding: 0 33rpx; | padding: 0 33rpx; | ||||
| } | } | ||||
| .cards>view:nth-of-type(2n){ | |||||
| .cards>view:nth-of-type(2n) { | |||||
| float: right; | float: right; | ||||
| } | } | ||||
| .cards>view:nth-of-type(2n+1){ | |||||
| .cards>view:nth-of-type(2n+1) { | |||||
| float: left; | float: left; | ||||
| } | } | ||||
| .tit{ | |||||
| font-size:36rpx; | |||||
| color:rgba(51,51,51,1); | |||||
| .tit { | |||||
| font-size: 36rpx; | |||||
| color: rgba(51, 51, 51, 1); | |||||
| margin: -40rpx auto 0; | margin: -40rpx auto 0; | ||||
| white-space: nowrap; | white-space: nowrap; | ||||
| text-overflow: ellipsis; | text-overflow: ellipsis; | ||||
| overflow: hidden; | overflow: hidden; | ||||
| width:280rpx; | |||||
| width: 280rpx; | |||||
| text-align: center; | text-align: center; | ||||
| } | } | ||||
| .cardtype{ | |||||
| .cardtype { | |||||
| position: absolute; | position: absolute; | ||||
| right: 28rpx; | right: 28rpx; | ||||
| top: 20rpx; | top: 20rpx; | ||||
| font-size: 24rpx; | |||||
| color:rgba(99,188,230,1); | |||||
| font-size: 24rpx; | |||||
| color: rgba(99, 188, 230, 1); | |||||
| } | } | ||||
| .footer{ | |||||
| .footer { | |||||
| margin-top: 26rpx; | margin-top: 26rpx; | ||||
| font-size:26rpx; | |||||
| font-weight:500; | |||||
| color:rgba(153,153,153,1); | |||||
| font-size: 26rpx; | |||||
| font-weight: 500; | |||||
| color: rgba(153, 153, 153, 1); | |||||
| } | } | ||||
| .footer text{ | |||||
| .footer text { | |||||
| text-indent: 33rpx; | text-indent: 33rpx; | ||||
| } | } | ||||
| .footer image{ | |||||
| .footer image { | |||||
| width: 24rpx; | width: 24rpx; | ||||
| margin-right: 33rpx; | margin-right: 33rpx; | ||||
| } | |||||
| .triangle { | |||||
| width: 0px; | |||||
| height: 0px; | |||||
| border-color: transparent #DAB055; | |||||
| border-width: 0 0 110rpx 110rpx; | |||||
| border-style: solid; | |||||
| } | |||||
| .discount{ | |||||
| position: absolute; | |||||
| right: 0rpx; | |||||
| bottom: 20rpx; | |||||
| } | |||||
| .triangle { | |||||
| width: 0px; | |||||
| height: 0px; | |||||
| border-color: transparent #dab055; | |||||
| border-width: 0 0 110rpx 110rpx; | |||||
| border-style: solid; | |||||
| } | |||||
| .discount { | |||||
| position: absolute; | position: absolute; | ||||
| color: #fff; | color: #fff; | ||||
| width: 110rpx; | width: 110rpx; | ||||
| height: 100rpx; | height: 100rpx; | ||||
| font-size: 20rpx; | font-size: 20rpx; | ||||
| left:13rpx; | |||||
| top:-11rpx; | |||||
| left: 13rpx; | |||||
| top: -11rpx; | |||||
| z-index: 10; | z-index: 10; | ||||
| transform:rotate(315deg); | |||||
| transform: rotate(315deg); | |||||
| } | } | ||||
| .discount text{ | |||||
| .discount text { | |||||
| font-size: 28rpx; | font-size: 28rpx; | ||||
| } | } | ||||
| .level{ | |||||
| .level { | |||||
| color: yellow; | color: yellow; | ||||
| } | } | ||||
| #mycanvas2{ | |||||
| #mycanvas2 { | |||||
| height: 300rpx; | height: 300rpx; | ||||
| width: 300rpx; | width: 300rpx; | ||||
| margin: 40rpx auto 20rpx; | margin: 40rpx auto 20rpx; | ||||
| } | } | ||||
| .goback{ | |||||
| .goback { | |||||
| position: fixed; | position: fixed; | ||||
| right: 50rpx; | right: 50rpx; | ||||
| bottom: 60rpx; | bottom: 60rpx; | ||||
| width:100rpx!important; | |||||
| height:100rpx; | |||||
| width: 100rpx !important; | |||||
| height: 100rpx; | |||||
| z-index: 100; | z-index: 100; | ||||
| background:rgba(255,255,255,1); | |||||
| background: rgba(255, 255, 255, 1); | |||||
| line-height: 95rpx; | line-height: 95rpx; | ||||
| border:1rpx solid rgba(227,227,227,1); | |||||
| border-radius:50%; | |||||
| border: 1rpx solid rgba(227, 227, 227, 1); | |||||
| border-radius: 50%; | |||||
| } | } | ||||
| .goback image{ | |||||
| .goback image { | |||||
| position: absolute; | position: absolute; | ||||
| width: 60rpx; | width: 60rpx; | ||||
| left: 0; | left: 0; | ||||
| @@ -128,26 +154,33 @@ Page{ | |||||
| bottom: 0; | bottom: 0; | ||||
| margin: auto; | margin: auto; | ||||
| } | } | ||||
| .code{ | |||||
| .code { | |||||
| width: 684rpx; | width: 684rpx; | ||||
| background: #fff; | background: #fff; | ||||
| margin: 0 auto; | margin: 0 auto; | ||||
| border-radius:10rpx; | |||||
| border-radius: 10rpx; | |||||
| padding: 20rpx 0 40rpx; | padding: 20rpx 0 40rpx; | ||||
| } | } | ||||
| .code text{ | |||||
| .code text { | |||||
| color: #666; | color: #666; | ||||
| display: block; | display: block; | ||||
| text-align: center; | text-align: center; | ||||
| font-size: 28rpx; | font-size: 28rpx; | ||||
| } | } | ||||
| #barcode{ | |||||
| #barcode { | |||||
| width: 600rpx; | width: 600rpx; | ||||
| height: 150rpx; | height: 150rpx; | ||||
| margin: 0 auto 10rpx; | margin: 0 auto 10rpx; | ||||
| } | } | ||||
| .code image{ | |||||
| .code image { | |||||
| display: block; | display: block; | ||||
| width: 500rpx; | width: 500rpx; | ||||
| margin: 0 auto; | margin: 0 auto; | ||||
| } | |||||
| .building{ | |||||
| display: inline-block; | |||||
| } | } | ||||
| @@ -24,24 +24,24 @@ Page({ | |||||
| wmspellgroup: imgurl.wmspellgroup.url, | wmspellgroup: imgurl.wmspellgroup.url, | ||||
| canIUse: wx.canIUse('official-account'), | canIUse: wx.canIUse('official-account'), | ||||
| flag: 'hidden', | flag: 'hidden', | ||||
| score:'0', | |||||
| name:"", | |||||
| birthdate:"", | |||||
| sex:"", | |||||
| showEdit:false, | |||||
| ismember:false, | |||||
| showQrcode:false, | |||||
| score: '0', | |||||
| name: "", | |||||
| birthdate: "", | |||||
| sex: "", | |||||
| showEdit: false, | |||||
| ismember: false, | |||||
| showQrcode: false, | |||||
| canvasHidden: false, | canvasHidden: false, | ||||
| maskHidden: true, | maskHidden: true, | ||||
| imagePath: '', | imagePath: '', | ||||
| appVersion:"", | |||||
| appVersion: "", | |||||
| showmemberqrcode: false, | showmemberqrcode: false, | ||||
| placeholder: '' | placeholder: '' | ||||
| }, | }, | ||||
| /** | /** | ||||
| * 跳转到成长值的页面 | * 跳转到成长值的页面 | ||||
| */ | */ | ||||
| gotograde:function(){ | |||||
| gotograde: function() { | |||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: '/pages/czdetail/czdetail', | url: '/pages/czdetail/czdetail', | ||||
| }) | }) | ||||
| @@ -57,16 +57,45 @@ Page({ | |||||
| */ | */ | ||||
| let that = this; | let that = this; | ||||
| if (that.data.flag == 'hidden') { | if (that.data.flag == 'hidden') { | ||||
| that.setData({ | |||||
| that.setData({ | |||||
| flag: 'show' | flag: 'show' | ||||
| }); | }); | ||||
| } | } | ||||
| }, | }, | ||||
| gotoedit:function(){ | |||||
| gotoedit: function() { | |||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: '/pages/edit/edit', | url: '/pages/edit/edit', | ||||
| }) | }) | ||||
| }, | }, | ||||
| onLoad() { | |||||
| this.getLocation(); | |||||
| }, | |||||
| /** | |||||
| * 获得经纬度 | |||||
| */ | |||||
| getLocation() { | |||||
| let that = this; | |||||
| wx.getLocation({ | |||||
| type: "wgs84", | |||||
| success: function(res) { | |||||
| console.log(res) | |||||
| if (res && res.longitude && res.latitude) { | |||||
| Http.post({ | |||||
| url: config.api.updateLBS, | |||||
| data: { | |||||
| latitude: res.latitude, | |||||
| longitude: res.longitude | |||||
| } | |||||
| }).then(res => { | |||||
| console.log(res) | |||||
| }) | |||||
| } | |||||
| }, | |||||
| fail: error => { | |||||
| console.log(error); | |||||
| } | |||||
| }) | |||||
| }, | |||||
| /** | /** | ||||
| * 生命周期函数--监听页面显示 | * 生命周期函数--监听页面显示 | ||||
| */ | */ | ||||
| @@ -79,7 +108,7 @@ Page({ | |||||
| * couponNum | * couponNum | ||||
| * couponNum2 | * couponNum2 | ||||
| */ | */ | ||||
| let num = wx.getStorageSync('couponNum'); | |||||
| let num = wx.getStorageSync('couponNum'); | |||||
| let num1 = wx.getStorageSync('couponNum2'); | let num1 = wx.getStorageSync('couponNum2'); | ||||
| wx.hideTabBarRedDot({ | wx.hideTabBarRedDot({ | ||||
| index: 3 | index: 3 | ||||
| @@ -115,46 +144,48 @@ Page({ | |||||
| }; | }; | ||||
| Http.get({ | Http.get({ | ||||
| url: config.api.getScore, | |||||
| data: {} | |||||
| }).then(res=>{ | |||||
| if (res.data.address && res.data.name && res.data.sex && res.data.birthdate){ | |||||
| url: config.api.getScore, | |||||
| data: {} | |||||
| }).then(res => { | |||||
| if (res.data.address && res.data.name && res.data.sex && res.data.birthdate) { | |||||
| that.setData({ | |||||
| showEdit: true | |||||
| }) | |||||
| } | |||||
| that.setData({ | that.setData({ | ||||
| showEdit:true | |||||
| score: res.data.score, | |||||
| levelName: res.data.levelName, | |||||
| }) | }) | ||||
| } | |||||
| that.setData({ | |||||
| score: res.data.score, | |||||
| levelName: res.data.levelName, | |||||
| if (res.data.nickName) { | |||||
| that.setData({ | |||||
| ismember: true, | |||||
| memberId: res.data.id | |||||
| }) | |||||
| var size = this.setCanvasSize(); | |||||
| var initUrl = JSON.stringify({ | |||||
| flagid: res.data.id | |||||
| }); | |||||
| that.createQrCode(initUrl, "mycanvas1", size.w, size.h); | |||||
| } | |||||
| }) | }) | ||||
| if (res.data.nickName){ | |||||
| that.setData({ | |||||
| ismember:true, | |||||
| memberId: res.data.id | |||||
| .catch(err => { | |||||
| wx.showModal({ | |||||
| title: '提示', | |||||
| content: err.errMsg, | |||||
| showCancel: false | |||||
| }) | }) | ||||
| var size = this.setCanvasSize(); | |||||
| var initUrl = JSON.stringify({flagid:res.data.id}); | |||||
| that.createQrCode(initUrl, "mycanvas1", size.w, size.h); | |||||
| } | |||||
| }) | |||||
| .catch(err => { | |||||
| wx.showModal({ | |||||
| title: '提示', | |||||
| content: err.errMsg, | |||||
| showCancel:false | |||||
| }) | }) | ||||
| }) | |||||
| //暂时注释 | //暂时注释 | ||||
| // that.getrun(); | // that.getrun(); | ||||
| }, | }, | ||||
| hideQrcode:function(){ | |||||
| hideQrcode: function() { | |||||
| let that = this; | let that = this; | ||||
| that.setData({ | that.setData({ | ||||
| showQrcode: false | showQrcode: false | ||||
| }) | }) | ||||
| }, | }, | ||||
| //适配不同屏幕大小的canvas | //适配不同屏幕大小的canvas | ||||
| setCanvasSize: function () { | |||||
| setCanvasSize: function() { | |||||
| var size = {}; | var size = {}; | ||||
| try { | try { | ||||
| var res = wx.getSystemInfoSync(); | var res = wx.getSystemInfoSync(); | ||||
| @@ -171,26 +202,26 @@ Page({ | |||||
| } | } | ||||
| return size; | return size; | ||||
| }, | }, | ||||
| createQrCode: function (url, canvasId, cavW, cavH) { | |||||
| createQrCode: function(url, canvasId, cavW, cavH) { | |||||
| //调用插件中的draw方法,绘制二维码图片 | //调用插件中的draw方法,绘制二维码图片 | ||||
| QR.api.draw(url, canvasId, cavW, cavH); | QR.api.draw(url, canvasId, cavW, cavH); | ||||
| }, | }, | ||||
| qrcode: function (e) { | |||||
| qrcode: function(e) { | |||||
| var that = this; | var that = this; | ||||
| that.setData({ | that.setData({ | ||||
| showQrcode:true | |||||
| showQrcode: true | |||||
| }) | }) | ||||
| wx.showToast({ | wx.showToast({ | ||||
| title: '生成中...', | title: '生成中...', | ||||
| icon: 'loading', | icon: 'loading', | ||||
| duration: 2000 | duration: 2000 | ||||
| }); | }); | ||||
| var st = setTimeout(function () { | |||||
| var st = setTimeout(function() { | |||||
| wx.hideToast() | wx.hideToast() | ||||
| var size = that.setCanvasSize(); | var size = that.setCanvasSize(); | ||||
| var url = JSON.stringify({ | var url = JSON.stringify({ | ||||
| END:"C", | |||||
| TYPE:"memberCode", | |||||
| END: "C", | |||||
| TYPE: "memberCode", | |||||
| ID: that.data.memberId, | ID: that.data.memberId, | ||||
| }) | }) | ||||
| that.createQrCode(url, "mycanvas1", size.w, size.h); | that.createQrCode(url, "mycanvas1", size.w, size.h); | ||||
| @@ -201,9 +232,9 @@ Page({ | |||||
| }, 1000) | }, 1000) | ||||
| }, | }, | ||||
| close: function () { | |||||
| close: function() { | |||||
| this.setData({ | this.setData({ | ||||
| showmemberqrcode: false, | showmemberqrcode: false, | ||||
| }) | }) | ||||
| } | } | ||||
| }); | |||||
| }); | |||||