ljc 5 роки тому
джерело
коміт
1e4bb51049
10 змінених файлів з 146 додано та 51 видалено
  1. +7
    -1
      laomenkuang_project/pages/TicketDetails/TicketDetails.js
  2. +23
    -2
      laomenkuang_project/pages/buyTicket/buyTicket.js
  3. +30
    -5
      laomenkuang_project/pages/givePage/givePage.js
  4. +13
    -1
      laomenkuang_project/pages/index/index.js
  5. +17
    -8
      laomenkuang_project/pages/personalCenter/personalCenter.js
  6. +32
    -25
      laomenkuang_project/pages/receiveTicket/receiveTicket.js
  7. +9
    -2
      laomenkuang_project/pages/register/register.js
  8. +10
    -6
      laomenkuang_project/pages/shop/shop.js
  9. +1
    -1
      laomenkuang_project/pages/shop/shop.wxml
  10. +4
    -0
      laomenkuang_project/pages/shop/shop.wxss

+ 7
- 1
laomenkuang_project/pages/TicketDetails/TicketDetails.js Переглянути файл

@@ -99,6 +99,12 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {

return {
title: "老门框爆肚会员",
path: "/pages/register/register",
success: res => {
console.log(res, "转发成功")
},
}
}
})

+ 23
- 2
laomenkuang_project/pages/buyTicket/buyTicket.js Переглянути файл

@@ -85,7 +85,13 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {

return {
title: "老门框爆肚会员",
path: "/pages/register/register",
success: res => {
console.log(res, "转发成功")
},
}
},
addFn:function(){
// if (this.data.num<5){
@@ -104,11 +110,26 @@ Page({
}
},
buySuccess:function(){//购买下单
if (!this.data.buyNumber) {
wx.showToast({
title: '请先输入购买优惠券的数量',
icon: "none",
duration: 2000
})
return;
} else if (this.data.buyNumber == 0) {
wx.showToast({
title: '购买优惠券的数量最小为1',
icon: "none",
duration: 2000
})
return;
}
if (this.data.yesClick){
return;
}
this.data.yesClick = true;
app.wxRequest(app.globalData.httpUrl + 'order/set', { coupon_sell_id: this.data.ticketUser.coupon_sell_id, buy_num: this.data.buyNumber}, e => {
this.data.yesClick = true;
console.log(e)
if (e.code == 200) {
this.setData({

+ 30
- 5
laomenkuang_project/pages/givePage/givePage.js Переглянути файл

@@ -59,6 +59,22 @@ Page({
}, this)
},
shareBtn:function(){
console.log(this.data.buyNumber)
if (!this.data.buyNumber){
wx.showToast({
title: '请先输入赠送好友优惠券的数量',
icon:"none",
duration:2000
})
return;
} else if (this.data.buyNumber==0){
wx.showToast({
title: '赠送好友优惠券的数量最小为1',
icon: "none",
duration: 2000
})
return;
}
if (!this.data.yesShare) {
this.data.yesShare = true;
this.getShareId();
@@ -121,12 +137,20 @@ Page({
yesShare:false,
})
var shareUrl = "";//分享指定路径
var titleWord = "";//title
var shareImg = "";//分享图
if (options.from === "button"){
shareUrl = '/pages/receiveTicket/receiveTicket?shareId=' + this.data.shareId + "&number=" + this.data.buyNumber
titleWord = "赠送给好友"
shareImg = this.data.ticketUser.coupon_img_small;
}else{
shareUrl = "/pages/register/register";
titleWord = "老门框爆肚会员"
shareImg = "";
}
return{
title:"赠送给好友",
imageUrl: this.data.ticketUser.coupon_img_small,
title: titleWord,
imageUrl: shareImg,
path: shareUrl,
success: res=> {
console.log(res, "转发成功")
@@ -152,10 +176,11 @@ Page({
getInputVal: function (e) {
if (e.detail.value <= this.data.surplusNum){
console.log(this.data.buyNumber)
// if (e.detail.value < 1) {
// if (e.detail.value == 0) {
// wx.showToast({
// title: "赠送量最小为1",
// duration: 1000
// title: "赠送数量最小为1",
// icon:"none",
// duration: 2000
// })
// this.setData({
// buyNumber: 1,

+ 13
- 1
laomenkuang_project/pages/index/index.js Переглянути файл

@@ -41,5 +41,17 @@ Page({
this.setData({
showMask: false
})
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
return {
title: "老门框爆肚会员",
path: "/pages/register/register",
success: res => {
console.log(res, "转发成功")
},
}
},
})

+ 17
- 8
laomenkuang_project/pages/personalCenter/personalCenter.js Переглянути файл

@@ -34,12 +34,13 @@ Page({
app.globalData.openidSuccessFuc = this.myTicket;
app.globalData.openidSuccessFuc = this.historyTicket;
}
console.log(app.globalData.userInfo)
if (app.globalData.userInfo.item_state == 2) {
var userInfo = wx.getStorageSync('userInfo');
var phone = wx.getStorageSync('user_phone');
console.log(userInfo)
if (userInfo) {
var userArr = [];
var phone="";
userArr.push(app.globalData.userInfo.headimgurl);
userArr.push(app.globalData.userInfo.nickname);
userArr.push(userInfo.avatarUrl);
userArr.push(userInfo.nickName);
phone = app.globalData.userInfo.user_phone
console.log(phone)
this.setData({
@@ -134,7 +135,13 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {

return {
title: "老门框爆肚会员",
path: "/pages/register/register",
success: res => {
console.log(res, "转发成功")
},
}
},
lookMyTicket:function(){
this.setData({
@@ -179,11 +186,13 @@ Page({
},
getUser:function(e){//点击登陆获取用户信息
console.log(e)

wx.setStorageSync('userInfo', e.detail.userInfo);
var phone = wx.getStorageSync('user_phone');
var userArr = [];
var phone = "";
userArr.push(e.detail.userInfo.avatarUrl);
userArr.push(e.detail.userInfo.nickName);
phone = app.globalData.user_phone
// phone = app.globalData.user_phone
console.log(phone)
this.data.userChuan = e.detail.userInfo;
this.setData({

+ 32
- 25
laomenkuang_project/pages/receiveTicket/receiveTicket.js Переглянути файл

@@ -27,7 +27,6 @@ Page({
ticketNum: options.number
})


var state = wx.getStorageSync('state');
if (state == 1) {//已注册
if (app.globalData.openId) {
@@ -39,7 +38,7 @@ Page({
showAll:true
})
} else if (state == 0) {//未注册
wx.switchTab({
wx.navigateTo({
url: '/pages/register/register'
})
} else if (state == -1) {
@@ -54,7 +53,7 @@ Page({
showAll: true
})
} else {
wx.switchTab({
wx.navigateTo({
url: '/pages/register/register'
})
}
@@ -153,33 +152,41 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {

return {
title: "老门框爆肚会员",
path: "/pages/register/register",
success: res => {
console.log(res, "转发成功")
},
}
},
// "p1583474312b94"
getTicketFn: function () {//点击领取优惠券
var id = this.data.presentId;
if (!this.data.moreClick) {
app.wxRequest(app.globalData.httpUrl + 'couponbuy/receivepresent', { present_id: id }, e => {
console.log(e)
this.data.moreClick = true;
if (e.code == 200) {
wx.showToast({
title: '领取成功',
duration: 500
})
setTimeout(() => {
wx.switchTab({
url: '/pages/index/index'
})
}, 500)
} else {
wx.showToast({
title: e.message,
duration: 500
})
}
}, this, "POST")
if (this.data.moreClick){
return;
}
this.data.moreClick = true;
app.wxRequest(app.globalData.httpUrl + 'couponbuy/receivepresent', { present_id: id }, e => {
console.log(e)
if (e.code == 200) {
wx.showToast({
title: '领取成功',
duration: 500
})
setTimeout(() => {
wx.switchTab({
url: '/pages/index/index'
})
}, 500)
} else {
this.data.moreClick = false;
wx.showToast({
title: e.message,
duration: 500
})
}
}, this, "POST")
},
backIndex:function(){//优惠券已被领取,点击确定返回首页
wx.switchTab({

+ 9
- 2
laomenkuang_project/pages/register/register.js Переглянути файл

@@ -94,7 +94,13 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {

return {
title: "老门框爆肚会员",
path: "/pages/register/register",
success: res => {
console.log(res, "转发成功")
},
}
},

yesCodeFn:function(){//验证码接口
@@ -210,7 +216,8 @@ Page({
this.data.yesRegister = true;
if (e.code == 200) {
clearInterval(time);
app.globalData.user_phone = e.data.user_phone
wx.setStorageSync('user_phone', e.data.user_phone);
wx.setStorageSync('state', 1);
this.setData({
minter: 60,
num: 60

+ 10
- 6
laomenkuang_project/pages/shop/shop.js Переглянути файл

@@ -19,16 +19,14 @@ Page({
showDataArr:[],//展示的数据列表
dataArr: [],//搜索的数据列表
getDataArr:[],//每次下拉获取的数据
topNum:0,//滚动条位置
},
bindchange:function(e){
wx.pageScrollTo({
scrollTop: 0,
duration: 300
})
this.data.pageNum = 1;
this.data.dataArr = [];
this.setData({
inputVal:""
inputVal:"",
topNum:0
})
this.searchShop();
},
@@ -210,7 +208,13 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {

return {
title: "老门框爆肚会员",
path: "/pages/register/register",
success: res => {
console.log(res, "转发成功")
},
}
},
callPhone:function(e){//拨打电话
var index = e.target.dataset.index;

+ 1
- 1
laomenkuang_project/pages/shop/shop.wxml Переглянути файл

@@ -18,7 +18,7 @@
</view>

<!-- <view class="content"> -->
<scroll-view scroll-y="true" style="height:{{scrollHig}}px" bindscrolltolower="lower">
<scroll-view scroll-y="true" style="height:{{scrollHig}}px" scroll-top='{{topNum}}' bindscrolltolower="lower">
<view>
<view class="getData" wx:for="{{showDataArr}}">
<view class="imgView">

+ 4
- 0
laomenkuang_project/pages/shop/shop.wxss Переглянути файл

@@ -114,6 +114,10 @@ page{
font-size:26rpx;
font-family:SourceHanSansCN;
color:rgba(102,102,102,1);
width: 700rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.addressIcon{
width: 21rpx;

Завантаження…
Відмінити
Зберегти