ljc 5 lat temu
rodzic
commit
8e9e7d4d18
8 zmienionych plików z 28 dodań i 22 usunięć
  1. +4
    -3
      laomenkuang_project/app.js
  2. +8
    -6
      laomenkuang_project/pages/TicketDetails/TicketDetails.js
  3. +5
    -3
      laomenkuang_project/pages/buyTicket/buyTicket.js
  4. +5
    -5
      laomenkuang_project/pages/givePage/givePage.js
  5. BIN
      laomenkuang_project/pages/images/ruleMask.png
  6. +1
    -1
      laomenkuang_project/pages/index/index.js
  7. +1
    -1
      laomenkuang_project/pages/index/index.wxss
  8. +4
    -3
      laomenkuang_project/pages/receiveTicket/receiveTicket.js

+ 4
- 3
laomenkuang_project/app.js Wyświetl plik

// logs.unshift(Date.now()) // logs.unshift(Date.now())
// wx.setStorageSync('logs', logs) // wx.setStorageSync('logs', logs)
var openid = wx.getStorageSync('openid') || ""; var openid = wx.getStorageSync('openid') || "";
console.log(this.globalData.present_id)
// 登录 // 登录
if (!openid){ if (!openid){
wx.login({ wx.login({
}, },
getUserType: function () {//获取用户注册状态 getUserType: function () {//获取用户注册状态
console.log(this.globalData.openId) console.log(this.globalData.openId)
this.wxRequest(this.globalData.httpUrl + 'getinfo',{},e=>{
this.wxRequest(this.globalData.httpUrl + 'getinfo', {},e=>{
console.log(e) console.log(e)
if(e.code==201){//未注册跳到注册页面 if(e.code==201){//未注册跳到注册页面
wx.reLaunch({ wx.reLaunch({
url: '/pages/register/register' url: '/pages/register/register'
}) })
} else if (e.code == 202){//已注册
} else if (e.code == 202) {//已注册
this.globalData.userInfo = e.data; this.globalData.userInfo = e.data;
console.log(this.globalData.userInfo)
if (this.globalData.present_id){ if (this.globalData.present_id){
} else { } else {
}, },
globalData: { globalData: {
openidSuccessFuc: null,//方法回调 openidSuccessFuc: null,//方法回调
userInfoSuccessFuc: null,//方法回调
userInfo: null, userInfo: null,
present_id:"",//判断用户是通过领取优惠券进来的还是直接进的 present_id:"",//判断用户是通过领取优惠券进来的还是直接进的
number:"",//赠送优惠券的数量 number:"",//赠送优惠券的数量

+ 8
- 6
laomenkuang_project/pages/TicketDetails/TicketDetails.js Wyświetl plik

ticketStateArr:[],//优惠券使用状态 ticketStateArr:[],//优惠券使用状态
codePicUrl:"",//二维码图片地址 codePicUrl:"",//二维码图片地址
yesCode: false,//二维码图片隐藏 yesCode: false,//二维码图片隐藏
id:""
}, },


/** /**
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(options.id) console.log(options.id)
this.data.id = options.id;
if (app.globalData.openId) { if (app.globalData.openId) {
this.getTicketUser(options.id, 1)
this.getCodeFn(options.id)
this.getTicketUser()
this.getCodeFn()
} else { } else {
app.globalData.openidSuccessFuc = this.getTicketUser; app.globalData.openidSuccessFuc = this.getTicketUser;
app.globalData.openidSuccessFuc = this.getCodeFn; app.globalData.openidSuccessFuc = this.getCodeFn;
} }
}, },
getTicketUser: function (id,from) {//获取优惠券信息
app.wxRequest(app.globalData.httpUrl + 'couponsell/detail', { coupon_sell_id: id, from: from}, e => {
getTicketUser: function () {//获取优惠券信息
app.wxRequest(app.globalData.httpUrl + 'couponsell/detail', { coupon_sell_id: this.data.id, from: 1}, e => {
console.log(e) console.log(e)
if (e.code == 200) { if (e.code == 200) {
this.setData({ this.setData({
} }
}, this) }, this)
}, },
getCodeFn:function(id){//获取二维码
app.wxRequest(app.globalData.httpUrl + 'couponbuy/getqrcode', { coupon_sell_id: id}, e => {
getCodeFn:function(){//获取二维码
app.wxRequest(app.globalData.httpUrl + 'couponbuy/getqrcode', { coupon_sell_id: this.data.id}, e => {
console.log(e) console.log(e)
if (e.code == 200) { if (e.code == 200) {
this.setData({ this.setData({

+ 5
- 3
laomenkuang_project/pages/buyTicket/buyTicket.js Wyświetl plik

ticketUser: [],//优惠券信息 ticketUser: [],//优惠券信息
orderUser:[],//下单信息 orderUser:[],//下单信息
sign_num:"",//确认支付参数 sign_num:"",//确认支付参数
id:""
}, },


/** /**
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(options) console.log(options)
this.data.id = options.index;
if (app.globalData.openId) { if (app.globalData.openId) {
this.getTicketUser(options.index, 1)
this.getTicketUser()
} else { } else {
app.globalData.openidSuccessFuc = this.getTicketUser; app.globalData.openidSuccessFuc = this.getTicketUser;
} }
}, },


getTicketUser:function(index,from){//获取优惠券信息
app.wxRequest(app.globalData.httpUrl + 'couponsell/detail', { coupon_sell_id: index, from: from}, e => {
getTicketUser:function(){//获取优惠券信息
app.wxRequest(app.globalData.httpUrl + 'couponsell/detail', { coupon_sell_id: this.data.id, from: 1}, e => {
console.log(e) console.log(e)
if (e.code == 200) { if (e.code == 200) {
this.setData({ this.setData({

+ 5
- 5
laomenkuang_project/pages/givePage/givePage.js Wyświetl plik

*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(options.id) console.log(options.id)

this.data.id = options.id
this.data.sellId = options.id;
if (app.globalData.openId) { if (app.globalData.openId) {
this.getTicketUser(options.id, 1)
this.getTicketUser()
} else { } else {
app.globalData.openidSuccessFuc = this.getTicketUser; app.globalData.openidSuccessFuc = this.getTicketUser;
} }
this.data.sellId = options.id;
}, },
getTicketUser: function (id, from) {//获取优惠券信息
app.wxRequest(app.globalData.httpUrl + 'couponsell/detail', { coupon_sell_id: id, from: from }, e => {
getTicketUser: function () {//获取优惠券信息
app.wxRequest(app.globalData.httpUrl + 'couponsell/detail', { coupon_sell_id: this.data.sellId, from: 2 }, e => {
console.log(e) console.log(e)
if (e.code == 200) { if (e.code == 200) {
this.setData({ this.setData({

BIN
laomenkuang_project/pages/images/ruleMask.png Wyświetl plik

Before After
Width: 576  |  Height: 950  |  Size: 44KB Width: 576  |  Height: 947  |  Size: 44KB

+ 1
- 1
laomenkuang_project/pages/index/index.js Wyświetl plik

}else{ }else{
app.globalData.openidSuccessFuc = this.getDataList; app.globalData.openidSuccessFuc = this.getDataList;
} }
},
},
getDataList:function(){ getDataList:function(){
app.wxRequest(app.globalData.httpUrl + 'couponsell/list', {}, e => { app.wxRequest(app.globalData.httpUrl + 'couponsell/list', {}, e => {
// console.log(e) // console.log(e)

+ 1
- 1
laomenkuang_project/pages/index/index.wxss Wyświetl plik

} }
.ruleMask{ .ruleMask{
width: 576rpx; width: 576rpx;
height: 950rpx;
height: 947rpx;
} }
.hiddenIcon{ .hiddenIcon{
width: 110rpx; width: 110rpx;

+ 4
- 3
laomenkuang_project/pages/receiveTicket/receiveTicket.js Wyświetl plik

}) })


if (app.globalData.openId) { if (app.globalData.openId) {
this.getTicketUser(options.shareId, options.number);
this.getTicketUser();
} else { } else {
app.globalData.openidSuccessFuc = this.getTicketUser; app.globalData.openidSuccessFuc = this.getTicketUser;
} }

}, },


getTicketUser: function (id,number) {//获取赠送优惠券信息
app.wxRequest(app.globalData.httpUrl + 'couponbuy/presentvisit', { present_id: id, present_num: number }, e => {
getTicketUser: function () {//获取赠送优惠券信息
app.wxRequest(app.globalData.httpUrl + 'couponbuy/presentvisit', { present_id: app.globalData.present_id, present_num: app.globalData.number }, e => {
console.log(e) console.log(e)
if (e.code == 201) { if (e.code == 201) {
var partPhone = e.data.user_phone.slice(0, 3) + "****" + e.data.user_phone.slice(7) var partPhone = e.data.user_phone.slice(0, 3) + "****" + e.data.user_phone.slice(7)

Ładowanie…
Anuluj
Zapisz