Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/parser.20200731.min/libs/MpHtmlParser.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ module.exports = {
// apiHost: 'https://api.it120.cc',//api工厂的值
subDomain: "9kuai8coffee.asia", // 固定值


version: "20.1.2",

note: '标签机 会员价 ',

merchantId: 27, // 商户ID,可在后台工厂设置-->商户信息查看
customerServiceType: 'QW' // 客服类型,QW为企业微信,需要在后台系统参数配置企业ID和客服URL,否则为小程序的默认客服
}
8 changes: 4 additions & 4 deletions pages/asset/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
<view class="b"><text>{{ $t.asset.send }}¥</text>{{item.send}}</view>
<van-icon wx:if="{{ruleSelIndex == index}}" custom-class="icon" name="success" />
</view>
<!--其他 <view class="item {{ruleSelIndex == -1 ? 'active' : ''}}" data-idx="-1" bindtap="changePersionNum">
<view class="a">{{ $t.asset.other }}</view>
<van-icon wx:if="{{ruleSelIndex == -1}}" custom-class="icon" name="success" />
</view> -->
<view class="item {{ruleSelIndex == -1 ? 'active' : ''}}" data-idx="-1" bindtap="changePersionNum">
<view class="a">{{ $t.asset.other }}</view>
<van-icon wx:if="{{ruleSelIndex == -1}}" custom-class="icon" name="success" />
</view>
</view>
<view class="btn">
<van-button type="primary" block bind:click="submit1">{{ $t.asset.confirmBtn }}</van-button>
Expand Down
2 changes: 1 addition & 1 deletion pages/coupons/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Page({
wx.showLoading({
title: '',
})
WXAPI.coupons().then(function (res) {
WXAPI.coupons({token: wx.getStorageSync('token')}).then(function (res) {
wx.hideLoading({
success: (res) => {},
})
Expand Down
3 changes: 2 additions & 1 deletion pages/coupons/index.wxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<wxs module="filters" src="../../utils/time.wxs"></wxs>
<van-sticky>
<van-tabs bind:change="tabClick">
<van-tab wx:for="{{ tabs[language] }}" wx:key="index" title="{{item}}"></van-tab>
Expand Down Expand Up @@ -28,7 +29,7 @@
<view class="n">{{item.name}}</view>
</view>
<view class="price">
<view class="tj">({{item.dateEnd}} {{ $t.coupons.expire }}) {{ $t.coupons.over }} {{item.moneyHreshold}}</view>
<view class="tj">({{filters.parseTime(item.expiryMillis,'date')}} {{ $t.coupons.expire }}) {{ $t.coupons.over }} {{item.moneyHreshold}}</view>
<view wx:if="{{ item.moneyType == 0 }}" class="amount"><text>¥</text>{{item.money}}</view>
<view wx:if="{{ item.moneyType == 1 }}" class="amount"><text></text>{{item.money}}<text>%</text></view>
</view>
Expand Down
2 changes: 1 addition & 1 deletion pages/index/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ Page({
showCouponPop: this.data.showCouponPop
})
},
changePeisongType(e) {
changePeisongType(e) {
const peisongType = e.currentTarget.dataset.type
this.setData({
peisongType
Expand Down
2 changes: 1 addition & 1 deletion pages/index/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@
<view class="couponOverlay-container">
<image src="/images/coupon.png" mode="widthFix" style="width: 80%;" bindtap="couponImageClick"></image>
</view>
</van-overlay>

</van-overlay>


<block wx:if="{{ scanDining }}">
Expand Down
16 changes: 7 additions & 9 deletions pages/pay/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ Page({
moneyUnit = '%'
}
if (ele.moneyHreshold) {
ele.nameExt = ele.name + + ' ['+ that.data.$t.pay.Fullconsumption +'' + ele.moneyHreshold + that.data.$t.pay.RMBreduced + ele.money + moneyUnit +']'
ele.nameExt = ele.name + ' ['+ that.data.$t.pay.Fullconsumption +'' + ele.moneyHreshold + that.data.$t.pay.RMBreduced + ele.money + moneyUnit +']'
} else {
ele.nameExt = ele.name + ' ['+ that.data.$t.pay.Fullconsumption +'' + ele.money + moneyUnit + ']'
}
Expand Down Expand Up @@ -383,7 +383,7 @@ Page({
console.log("余额支付:",r)
if(r.code==700){
//打印的数据
console.log("print:" ,that.data,res.data)
console.log("print:" ,that.data.goodsList,that.data.shopInfo,res.data)
//小票
that.print2(res.data)
//标签
Expand All @@ -406,11 +406,10 @@ Page({
remark: that.data.remark, //用户备注
peisongType: that.data.peisongType,//配置方式zq,kd


isPrint: true //打印标志

}
//打印的数据
console.log("print:" ,data)
wxpay.wxpay('order', money, res.data.id, "/pages/all-orders/index",data)
console.log("微信支付:")

Expand Down Expand Up @@ -702,20 +701,17 @@ Page({
let content = ''

for(let i=0;i<that.data.goodsList.length;i++){
for(let k=0;k<that.data.goodsList[i].number;k++){
content+= '<PAGE><SIZE>40,30</SIZE>' +
'<TEXT x="8" y="0" w="1" h="1" r="0"># '+(i+1) +'/' + that.data.goodsList.length + ' 总金额:'+data.amountReal + '</TEXT>'+
'<TEXT x="8" y="24" w="1" h="1" r="0">'+ that.data.goodsList[i].name +'</TEXT>'
for(let j=0;j<that.data.goodsList[i].sku.length;j++){
content+='<TEXT x="8" y="' + (j+2)*24 +'" w="1" h="1" r="0">'+ that.data.goodsList[i].sku[j].optionValueName +'</TEXT>'
}
content+= '<TEXT x="8" y="'+(that.data.goodsList[i].sku.length+2)*24 +'" w="1" h="1" r="0">'+'单价: ¥'+ that.data.goodsList[i].price + '</TEXT>'+
'<TEXT x="8" y="166" w="1" h="1" r="0">'+ data.orderNumber+ '</TEXT>'+
content+= '<TEXT x="8" y="'+(that.data.goodsList[i].sku.length+2)*24 +'" w="1" h="1" r="0">'+'单价: ¥'+ that.data.goodsList[i].price +'X'+ that.data.goodsList[i].number+ '</TEXT>'+
'<TEXT x="8" y="190" w="1" h="1" r="0">'+ timeStr + '</TEXT>'+
'<TEXT x="8" y="214" w="1" h="1" r="0">'+ that.data.shopInfo.name + '</TEXT>' + '</PAGE>'

}
}


//请求参数
Expand Down Expand Up @@ -774,7 +770,7 @@ Page({
}
//当前日期 时分秒
let timeStr = that.getDate()
let content = '<CB>9.8 COFFEE<BR><BR><BR></CB>' +'<TABLE col="22,3,7" w=1 h=1 b=0 lh=68> '
let content = '<CB>9.8 COFFEE小票<BR><BR><BR></CB>' +'<TABLE col="22,3,7" w=1 h=1 b=0 lh=68> '

for(let i=0;i<that.data.goodsList.length;i++){
content+= '<tr>'+ that.data.goodsList[i].name +'<td>' + that.data.goodsList[i].number +'<td>' + that.data.goodsList[i].price + '元</tr>'
Expand All @@ -783,6 +779,8 @@ Page({
content+= that.data.goodsList[i].sku[j].optionValueName + '|'
}
content+='<td> <td> </tr>'


}
content+='</TABLE>'
content+='<R>合计:'+ data.amountReal+'元<BR></R><BR>'
Expand Down
10 changes: 5 additions & 5 deletions pages/pay/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<van-icon name="shop-collect-o" color="{{peisongType == 'zq' ? '#fff' : '#333'}}" />
<view class="ziqu-1">{{ $t.index.pickup }}</view>
</view>
<view class="peisong ziqu {{peisongType == 'kd' ? 'active' : ''}}" bindtap="selected" data-pstype="kd">
<van-icon name="logistics" color="{{peisongType == 'kd' ? '#fff' : '#333'}}" />
<view class="peisong ziqu {{peisongType == 'pszq' ? 'active' : ''}}" bindtap="selected" data-pstype="pszq">
<van-icon name="logistics" color="{{peisongType == 'pszq' ? '#fff' : '#333'}}" />
<view class="ziqu-1">{{ $t.index.Delivery }}</view>
</view>
</view>
<van-divider dashed />
<!-- 地址 -->
<view class="address-box" wx:if="{{peisongType == 'kd'}}">
<view class="address-box" wx:if="{{peisongType == 'pszq'}}">
<view class="add-address" wx:if="{{!curAddressData}}" bindtap="addAddress">
<van-icon name="add-o" color="#e64340" size="48rpx" />
<view>{{ $t.pay.Addaddress }}</view>
Expand Down Expand Up @@ -98,10 +98,10 @@
wx:if="{{ nick && avatarUrl }}"
price="{{ amountReal*100 }}"
label="{{ $t.PickingUp.total }}"
button-text="{{peisongType == 'kd' && amountReal < shopInfo.serviceAmountMin ? ('¥' + shopInfo.serviceAmountMin + $t.pay.qisong) : $t.order.toPayTap }}"
button-text="{{peisongType == 'pszq' && amountReal < shopInfo.serviceAmountMin ? ('¥' + shopInfo.serviceAmountMin + $t.pay.qisong) : $t.order.toPayTap }}"
bind:submit="goCreateOrder"
button-class="pay-btn"
disabled="{{(peisongType == 'kd' && amountReal < shopInfo.serviceAmountMin) || submitLoding }}"
disabled="{{(peisongType == 'pszq' && amountReal < shopInfo.serviceAmountMin || curAddressData == null) || submitLoding }}"
/>
<van-submit-bar
wx:else
Expand Down
4 changes: 2 additions & 2 deletions project.private.config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"setting": {
"compileHotReLoad": true,
"urlCheck": true
"urlCheck": false
},
"condition": {
"miniprogram": {
Expand Down Expand Up @@ -307,7 +307,7 @@
]
}
},
"projectname": "bee-master2",
"projectname": "bee-master",
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"libVersion": "3.4.10"
}
7 changes: 1 addition & 6 deletions utils/pay.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,16 @@ function wxpay(type, money, orderId, redirectUrl, data) {
let content = ''

for(let i=0;i<data.goodsList.length;i++){
for(let k=0;k<that.data.goodsList[i].number;k++){
content+= '<PAGE><SIZE>40,30</SIZE>' +
'<TEXT x="8" y="0" w="1" h="1" r="0"># '+(i+1) +'/' + data.goodsList.length + ' 总金额:'+data.data.amountReal + '</TEXT>'+
'<TEXT x="8" y="24" w="1" h="1" r="0">'+ data.goodsList[i].name +'</TEXT>'
for(let j=0;j<data.goodsList[i].sku.length;j++){
content+='<TEXT x="8" y="' + (j+2)*24 +'" w="1" h="1" r="0">'+ data.goodsList[i].sku[j].optionValueName +'</TEXT>'
}
content+= '<TEXT x="8" y="'+(data.goodsList[i].sku.length+2)*24 +'" w="1" h="1" r="0">'+'单价: ¥'+ data.goodsList[i].price +'X'+ data.goodsList[i].number+ '</TEXT>'+
'<TEXT x="8" y="166" w="1" h="1" r="0">'+ data.data.orderNumber+ '</TEXT>'+
'<TEXT x="8" y="190" w="1" h="1" r="0">'+ timeStr + '</TEXT>'+
'<TEXT x="8" y="214" w="1" h="1" r="0">'+ data.shopInfo.name + '</TEXT>' + '</PAGE>'

}
}


Expand Down Expand Up @@ -184,7 +181,7 @@ for(let i=0;i<data.goodsList.length;i++){
}
//当前日期 时分秒
let timeStr = getDate()
let content = '<CB>9.8 COFFEE<BR><BR><BR></CB>' +'<TABLE col="22,3,7" w=1 h=1 b=0 lh=68> '
let content = '<CB>9.8 COFFEE小票<BR><BR><BR></CB>' +'<TABLE col="22,3,7" w=1 h=1 b=0 lh=68> '

for(let i=0;i<data.goodsList.length;i++){
content+= '<tr>'+ data.goodsList[i].name +'<td>' + data.goodsList[i].number +'<td>' + data.goodsList[i].price + '元</tr>'
Expand All @@ -208,8 +205,6 @@ for(let i=0;i<data.goodsList.length;i++){
content+='门店名称: ' + data.shopInfo.name +'<BR>' +
'备注: ' + data.remark +'<BR>'
content+= '</L>'




//请求参数
Expand Down
60 changes: 60 additions & 0 deletions utils/time.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
var filter = {
formatNumber: function (n) {
n = n.toString()
return n[1] ? n : '0' + n
},
//写法一:
parseTime: function (time, type) {
if (time == null || type == '') {
return ''
}
if (arguments.length === 0) {
return null
}
var date = getDate(time);//在wxs中不能使用new Date()来处理日期
var y = date.getFullYear();
var m = filter.formatNumber(date.getMonth() + 1);
var d = filter.formatNumber(date.getDate());
var h = filter.formatNumber(date.getHours());
var i = filter.formatNumber(date.getMinutes());
var s = filter.formatNumber(date.getSeconds());
var a = filter.formatNumber(date.getDay());
var time_str = "";
if (type == 'month') {
time_str = y + '-' + m;
} else if (type == 'date') {
time_str = y + '-' + m + '-' + d;
} else if (type == 'datetime') {
time_str = y + '-' + m + '-' + d + ' ' + h + ':' + i + ':' + s;
} else if (type == 'onlyMonth') {
time_str = m;
} else if (type == 'onlyYear') {
time_str = y;
}
return time_str
},
//写法二:
//用法 <text>{{filters.formatDate(current,'Y-M-D h:m:s')}}</text>
parseTime2: function (time, format) {
if (time == null || format == '' || time == "" || time == undefined) {
return ''
}
if (arguments.length === 0) {
return null
}
var formateArr = ['Y', 'M', 'D', 'h', 'm', 's'], arr = [], date = getDate(time);
arr.push(date.getFullYear());//Y
arr.push(filter.formatNumber(date.getMonth() + 1));//M
arr.push(filter.formatNumber(date.getDate()));//D
arr.push(filter.formatNumber(date.getHours()));//h
arr.push(filter.formatNumber(date.getMinutes()));//m
arr.push(filter.formatNumber(date.getSeconds()));//s
for (var i = 0; i < arr.length; i++) {
format = format.replace(formateArr[i], arr[i])
}
return format
},
}
module.exports = {
parseTime: filter.parseTime,
}