Commit 42d9ac86 authored by 华国豪's avatar 华国豪 🙄

合并代码

parents d66eec62 4db99a87
......@@ -85,6 +85,31 @@ App({
})
return promise;
},
$apiNew: function (url, data) {
var promise = new Promise((resolve, reject) => {
wx.showLoading({
title: '加载中',
});
let timestamp = (new Date()).valueOf()
let sign = md5('cmd=' + url + '&' + 'msg=' + encodeURIComponent(data).toLowerCase() + '&' + 'timestamp=' + timestamp + '&' + 'token=' + getApp().state.admin.token + '&' + 'key=' + '')
wx.request({
url: netUrl,
method: 'POST',
data: {
cmd: url,
msg: data,
timestamp: timestamp,
token: getApp().state.admin.token,
sign: sign
},
success(res) {
wx.hideLoading()
resolve(res.data.data);
}
})
})
return promise;
},
// 请求接口
$apiSaveFormId: function (url, data) {
var promise = new Promise((resolve, reject) => {
......
......@@ -65,7 +65,9 @@
"pages/Pay/Pay",
"pages/mine/Happypassbook/Happypassbook",
"pages/mine/UseDetails/UseDetails",
"pages/shopPage/shopPage"
"pages/shopPage/shopPage",
"pages/webview/webview",
"pages/Home/pay/pay"
],
"navigateToMiniProgramAppIdList": [
"wxb6bcc99626870225"
......
......@@ -36,12 +36,10 @@ Component({
getCityList() {
let city = "成都",
_this = this;
console.log(app.state.admin)
app.$api('b2b_get_site', {}).then(res => {
_this.setData({
cityList: res
})
console.log(_this.data.cityList)
}).catch(err => { })
if (app.state.locaSite) {
......@@ -60,7 +58,6 @@ Component({
'content-type': 'application/json' // 默认值
},
success(res) {
console.log("res")
city = res.data.result.address_component.city.replace('市', '');
app.state.locaSite = true
app.$api('b2b_get_site', {}).then(res => {
......@@ -84,7 +81,6 @@ Component({
_this.setData({
cityList: res
})
console.log(_this.data.cityList)
}).catch(err => { })
}
})
......
// pages/GroupTour/FillOrder/FillOrder.js
let app = getApp();
var util = require('../../../utils/util.js')
Page({
/**
......@@ -139,14 +141,9 @@ Page({
} else {
money = e.detail.value.substring(0, e.detail.value.length - 1);
}
console.log(money)
if (money !== "" && parseFloat(money) > this.data.RedEnvelopeMoneyALL) {
money = this.data.RedEnvelopeMoneyALL
wx.showToast({
title: '最大金额不能超过余额',
icon: 'none',
duration: 2000
})
util.shownone('最大金额不能超过余额');
}
this.setData({
RedMoney: parseFloat(money)
......@@ -165,19 +162,11 @@ Page({
//兑换码兑换
subCode: function () {
if (this.data.code == "") {
wx.showToast({
title: '请输入兑换码',
icon: 'none',
duration: 2000
})
util.shownone('请输入兑换码');
return
}
app.$apiJavaData("api/b2b/user/updateUseCouponBycode", { ActivateCode: this.data.code}).then(res => {
wx.showToast({
title: '兑换成功,请到优惠券列表查看',
icon: 'none',
duration: 2000
})
util.shownone('兑换成功,请到优惠券列表查看');
this.getCpList()
}).catch(err => { })
},
......@@ -191,7 +180,6 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
console.log(options)
let payInfo = wx.getStorageSync('payInfo');
this.setData({
payInfo: payInfo,
......@@ -201,7 +189,6 @@ Page({
let that = this;
let msg = {};
if (options) {
// console.log("options", options)
msg.configId = decodeURIComponent(options.idDes);
msg.tcid = options.tcid;
if (options.teamType) {
......@@ -268,11 +255,7 @@ Page({
if (str.test(phoneNumber)) {
return true
} else {
wx.showToast({
title: '手机号不正确',
duration: 500,
icon: 'none',
})
util.shownone('手机号不正确');
return false
}
},
......@@ -280,19 +263,11 @@ Page({
StartYd() {
let that = this;
if (that.data.payInfo.ContactMobile == "" || !that.data.payInfo.ContactMobile || that.data.payInfo.ContactMobile.length<11) {
wx.showToast({
title: "请输入正确的手机号",
icon: 'none',
duration: 1000
})
util.shownone('请输入正确的手机号');
return;
}
if (that.data.payInfo.ContactName == "" || !that.data.payInfo.ContactName) {
wx.showToast({
title: "请输入联系人姓名",
icon: 'none',
duration: 1000
})
util.shownone('请输入联系人姓名');
return;
}
this.data.payInfo.CouponAllotIds = this.data.CouponIds ? this.data.CouponIds.slice(0, this.data.CouponIds.length - 1) : ''
......
......@@ -61,7 +61,6 @@ Page({
},
GodetailList(e){
let item = e.currentTarget.dataset.item;
console.log(item)
wx.navigateTo({
url: '/pages/GroupTour/GroupDetails/GroupDetails?idDes=' + encodeURIComponent(item.id) + "&tcid=" + item.tcid + "&teamType=0",
})
......@@ -73,7 +72,6 @@ Page({
})
},
ChangeSite(val) {
console.log(val.detail);
this.setData({
site: val.detail
})
......@@ -146,7 +144,6 @@ Page({
dataList: [],
arrList: []
})
console.log("lineList", that.data.lineList)
this.GetLoadList(0);
}).catch(err => {})
},
......@@ -164,14 +161,12 @@ Page({
that.setData({
tiaoshui: res.pageData
})
console.log(that.data.tiaoshui)
}).catch(err => {
})
},
onPageScroll: function(e) {
let that=this;
// console.log(e);//{scrollTop:99}
let query = wx.createSelectorQuery();
//选择id
query.select('#scrollView').boundingClientRect()
......
......@@ -3,7 +3,7 @@
<view class="headerView">
<image class="headerbg" src="http://imgfile.oytour.com/New/Upload/Cloud/2019-11/20191108110833785.png"></image>
<view class="hdjxView">
<image class="headimg" src="http://imgfile.oytour.com/New/Upload/Cloud/2019-11/20191108110853895.png"></image>
<image class="headimg" src="http://imgfile.oytour.com/New/Upload/Cloud/2019-11/20191112104209660.png"></image>
</view>
<view id="searchView">
<search id="CityComp" bind:ChangeSite="ChangeSite"></search>
......@@ -64,12 +64,12 @@
<!-- 超值特卖 -->
<view class="CztmView">
<view bindtap="goWebView" class="imageView">
<image class="bannerImg" src="http://imgfile.oytour.com/New/Upload/Cloud/2019-11/20191108013851924.png"></image>
<image class="bannerImg" src="http://imgfile.oytour.com/New/Upload/Cloud/2019-11/20191112104155316.png"></image>
<image class="small" src="http://imgfile.oytour.com/New/Upload/Cloud/2019-11/20191108013907065.png"></image>
</view>
<view class="ContentView">
<view>
<image style="width:165rpx;height:26rpx" src="http://imgfile.oytour.com/New/Upload/Cloud/2019-11/20191108015629462.png"></image>
<image style="width:165rpx;height:26rpx" src="http://imgfile.oytour.com/New/Upload/Cloud/2019-11/20191112104204160.png"></image>
<text bindtap="goMore" data-url="/pages/GroupTour/GroupList/GroupList" style="font-size:24rpx;color:#888888;float:right;margin-top:15rpx">查看更多</text>
</view>
<view class="cztm cztm1">
......
let app = getApp();
Page({
data: {
timestamp: '',
openid: '',
customerId: '',
payInfo: {},
payBtn: true,
second: 180,
changesecond: true,
},
onLoad: function(options) {
let that = this;
let timestamp = parseInt(new Date().getTime() / 1000);
this.getOpenid();
let admin = wx.getStorageSync('admin');
this.setData({
customerId: admin.id
})
if (options.data) {
let info = that.data.payInfo;
let payInfo = JSON.parse(options.data)
info.sOrderNo = payInfo.sOrderNo;
info.sProductName = payInfo.sProductName;
info.dTotalPrice = payInfo.dTotalPrice;
info.productId = payInfo.productId;
that.setData({
payInfo: info
})
}
that.countdown(that);
},
getInfo() {
let that = this;
let payInfo = that.data.payInfo;
let msg = {
sType: 'wechatminpay',
sOrderNo: payInfo.sOrderNo,
sProductName: payInfo.sProductName,
dTotalPrice: payInfo.dTotalPrice,
CustomerId: that.data.customerId,
productId: payInfo.productId,
openid: that.data.openid,
type: '',
};
console.log("msg", msg)
app.$apiSaveFormId('sellorder_get_GetPayInfo', msg).then(res => {
console.log("res", res);
}).catch(err => {})
},
payBtn() {
let that = this;
if (!that.data.payBtn){
wx.showToast({
title: "您已经超出支付时间!",
icon: 'none',
duration: 1000
})
return;
}
wx.requestPayment({
'timeStamp': that.data.timestamp,
'nonceStr': '',
'package': '',
'signType': 'MD5',
'paySign': '',
'success': function(res) {},
'fail': function(res) {},
'complete': function(res) {}
})
},
getOpenid() {
let that = this;
wx.login({
success: res => {
this.setData({
code: res.code
})
if (res.code) {
app.$apiNew('miniProgram_customer_LoginByMinOpenId', {
code: res.code
}).then(res => {
this.setData({
openid: res.openid,
})
that.getInfo();
}).catch(err => {
})
} else {
wx.showToast({
title: '获取用户信息失败',
icon: 'none',
duration: 1000
})
}
}
})
},
countdown(that) {
var second = that.data.second
if (second == 0) {
that.setData({
payBtn: false,
changesecond: '00:00'
});
return;
}
var time = setTimeout(function() {
let str = that.formatSeconds(second);
that.setData({
second: second - 1,
changesecond:str,
});
that.countdown(that);
}, 1000)
},
formatSeconds(value) {
var theTime = parseInt(value); // 秒
var theTime1 = 0; // 分
if (theTime > 60) {
theTime1 = parseInt(theTime / 60);
theTime = parseInt(theTime % 60);
if (theTime1 > 60) {
theTime1 = parseInt(theTime1 % 60);
}
}
var result = "" + parseInt(theTime); //秒
if (10 > theTime > 0) {
result = "0" + parseInt(theTime); //秒
} else {
result = "" + parseInt(theTime); //秒
}
if (10 > theTime1 > 0) {
result = "0" + parseInt(theTime1) + ":" + result; //分,不足两位数,首位补充0,
} else {
result = "" + parseInt(theTime1) + ":" + result; //分
}
return result;
},
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<view class="bgView">
<view class="pay">
<view class="c99 f22 text">支付剩余时间 00:{{changesecond}}</view>
<view style="margin:20rpx 0" class="f30 text">¥{{payInfo.dTotalPrice}}</view>
<view class="c99 f22 text">{{payInfo.sProductName}}</view>
<view style="margin-top:50rpx;padding:0 30rpx">
<image style="width:30rpx;height:30rpx" src="../../../images/group/wx.png"></image>
<text style="margin-left:30rpx">微信支付</text>
<image style="width:36rpx;height:36rpx;float:right;margin-top:8rpx" src="../../../images/visa/xunazhong.png"></image>
</view>
</view>
<view bindtap="payBtn" class="{{payBtn?'ljzf':'ljzf disabled'}}">立即支付</view>
</view>
\ No newline at end of file
/* pages/Home/pay/pay.wxss */
.disabled{
background: #ccc!important;
color: #000000!important;
}
.pay{
background: #fff;
padding-bottom: 30rpx;
}
.text{
text-align: center;
}
.c99{
color: #999999;
}
.f22{
font-size: 22rpx;
}
.f30{
font-size: 30rpx;
}
.bgView{
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
.ljzf{
width:700rpx;
height:82rpx;
line-height:82rpx;
background:rgba(238,68,84,1);
border-radius:12rpx;
text-align: center;
color: #fff;
font-size:28rpx;
margin: 0 auto;
margin-top: 400rpx;
}
\ No newline at end of file
......@@ -64,12 +64,8 @@ Page({
phoneInput(e) {
let val = e.detail.value;
this.data.msg.contactMobile = val;
if (val.length > 11) {    
wx.showToast({     
title: '手机号有误',
     icon: 'none',
     duration: 500    
})   
if (val.length > 11) {  
util.shownone('手机号有误'); 
}  
this.setData({
msg: this.data.msg
......@@ -91,11 +87,7 @@ Page({
let tomonth = util.changeMonth(this.data.tomonth, num)
let today = util.YYMM(new Date());
if (!util.CompareDate(tomonth, today)) {
wx.showToast({
title: "不能选择过去的日期!",
icon: 'none',
duration: 1000
})
util.shownone('不能选择过去的日期!'); 
return;
}
this.setData({
......@@ -194,11 +186,7 @@ Page({
let that = this;
let msg = that.data.msg;
if (msg.useDate == "") {
wx.showToast({
title: "请选择使用日期",
icon: 'none',
duration: 1000
})
util.shownone('请选择使用日期'); 
return;
}
app.$apiJavaData('/api/b2b/scenic/setTicketOrder', msg).then(res => {
......@@ -207,11 +195,7 @@ Page({
url: '/pages/member/orderCenter/orderCenter?index=3',
})
} else {
wx.showToast({
title: res.message,
icon: 'none',
duration: 1000
})
util.shownone(res.message); 
}
}).catch(err => {})
......
......@@ -61,7 +61,6 @@ Page({
},
getlineTeam(e) {
console.log(e);
let item = e.currentTarget.dataset.item;
let index = e.currentTarget.dataset.index;
this.setData({
......@@ -79,14 +78,12 @@ Page({
fromOrigin: 1,
}
app.$apiJavaNew('/api/b2b/food/getHomeFoodList', msg).then(res => {
console.log("getFood")
console.log(res);
let list = res.pageData;
this.setData({
foodList: list
})
console.log("foodList", this.data.foodList);
}).catch(err => { })
},
......@@ -156,7 +153,6 @@ Page({
})
},
ChangeSite(val) {
console.log(val.detail);
this.setData({
site: val.detail
})
......
......@@ -82,7 +82,6 @@ Page({
wx.getStorage({
key: 'admin',
success: res => {
console.log(e)
let type = e.detail.target.dataset.type;
let formId = e.detail.formId
let url = '';
......@@ -126,7 +125,6 @@ Page({
},
// 获取数据
getList: function (type) {
console.log(this.data.pageIndex, this.data.totalPage, type)
if (this.data.pageIndex >= this.data.totalPage && type) {
return
}
......@@ -157,7 +155,6 @@ Page({
//切换类型
setActiveTag: function (e) {
let index = e.target.id.split('active')[1]
console.log(index)
this.setData({
dropdownActive: Number(index),
tagBoxShow: false,
......
......@@ -5,62 +5,21 @@ Page({
* 页面的初始数据
*/
data: {
urlHref:"http://127.0.0.1:5500/html/GT_activities.html",
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let admin = wx.getStorageSync('admin');
let customerId = admin.id;
let accountId = admin.customerAccountId;
let token = admin.token;
let secretKey = admin.secretKey;
let platform = "xcx";
let urlHref = this.data.urlHref + "?customerId=" + customerId + '&accountId=' + accountId + '&token=' + token + '&secretKey=' + secretKey + '&platform=' + platform;
this.setData({
urlHref: urlHref
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
<web-view src="https://www.baidu.com/"></web-view>
\ No newline at end of file
<web-view src="{{urlHref}}"></web-view>
\ No newline at end of file
......@@ -9,8 +9,16 @@
"postcss": true,
"minified": true,
"newFeature": true,
"coverView": true,
"autoAudits": false,
"checkInvalidKey": true
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"compileType": "miniprogram",
"libVersion": "2.7.7",
......@@ -44,7 +52,7 @@
"list": []
},
"miniprogram": {
"current": -1,
"current": 21,
"list": [
{
"id": 2,
......@@ -209,51 +217,10 @@
},
{
"id": -1,
"name": "测试弹出",
"pathName": "pages/Voucher/VoucherDetails/VoucherDetails",
"query": "tcid=5560",
"scene": null
},
{
"id": -1,
"name": "报名确认",
"pathName": "pages/product/SametradeZW/SametradeZW",
"name": "活动支付",
"pathName": "pages/Home/pay/pay",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/Home/home",
"pathName": "pages/Home/home",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/Home/home",
"pathName": "pages/Voucher/authenticat/authenticat",
"query": "",
"scene": null
},
{
"id": 29,
"name": "手机号确认",
"pathName": "pages/Voucher/Voucher",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/Home/home",
"pathName": "pages/product/SametradeZW/SametradeZW",
"query": "",
"scene": null
},
{
"id": -1,
"name": "填写意见调查",
"pathName": "pages/Voucher/VoucherDetails/VoucherDetails",
"scene": null
}
]
}
......
......@@ -136,6 +136,14 @@ const getNextMonth = (date) => {
var t2 = year2 + '-' + month2 + '-' + day2;
return t2;
}
const shownone = text => wx.showToast({
title: text,
icon: 'none',
duration: 1000
})
module.exports = {
formatTime: formatTime,
CompareDate: CompareDate,
......@@ -146,4 +154,5 @@ module.exports = {
AddDays: AddDays,
getNextMonth: getNextMonth,
getPreMonth: getPreMonth,
shownone: shownone
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment