作者 zhuwenjin@bronet.cn

海油修改

... ... @@ -49,13 +49,14 @@ App({
console.log(entrance_type);
if (entrance_type == '1' || url == '/getopenid/get' || url.indexOf('address') > -1 || url.indexOf('/wb/wb')>-1) {
//劳保商城入口
baseUrl = 'https://binhai.w.broing.cn/api';
// baseUrl = 'http://bhng.cn/api'
// baseUrl = 'https://binhai.w.broing.cn/api';
baseUrl = 'http://binhai.shs.broing.cn/api'
} else if (entrance_type == '2') {
//工会商城入口
baseUrl = 'https://binhaigh.w.broing.cn/api';
// baseUrl = 'https://binhaigh.w.broing.cn/api';
baseUrl = 'http://gonghui.shs.broing.cn/api'
} else if (entrance_type == '3') {
//工会商城入口
//办公入口
baseUrl = 'https://bgcb.w.broing.cn/api';
}
// 天远甄选
... ... @@ -161,6 +162,7 @@ App({
header: {
'content-type': 'application/x-www-form-urlencoded',
'token': wx.getStorageSync('token') || ''
// 'token': '' || ''
},
success: function (res) { //返回取得的数据
if (res.data.code == '1') {
... ... @@ -356,6 +358,7 @@ App({
shopcarNum: '/shop/shopcarnum', // 购物车数量
orderlist: '/shop/orderlist', // 订单各状态数量
order_read: '/shop/read', // 订单数
orderMixed: '/order/zhifu',
},
globalData: {
login_new: "",
... ...
... ... @@ -8,7 +8,9 @@ Page({
info:[],
item:'',
detail:{},
sel:0
sel:0,
kuaidiList: [],
sum: 0
},
// 复制物流编号
copy(e){
... ... @@ -39,8 +41,33 @@ Page({
this.setData({
item: res.msg.kuaidi[0]
})
this.setData({
id: res.msg.id
})
let sum = 0
this.data.info.forEach(item=>{
sum += item.goods_number
})
this.setData({
sum: sum
})
console.log(sum)
console.log(that.data.info)
// that.getOrderDetail(res.msg.id)
})
},
getOrderDetail(id) {
let that=this
let url = app.interface.orderInfo
let params = {
id: id
}
app.post(url,params).then((res)=>{
res.msg.kuaidi = JSON.parse(res.msg.kuaidi)
console.log(res.msg.kuaidi,'zzzzzzzzzzzzz')
this.setData({
kuaidiList: res.msg.kuaidi
})
})
},
lookMoreInfo(e){
... ...
... ... @@ -22,6 +22,9 @@
</view>
<view class="pack" wx:if="{{item.kuaidi.goods_number&&item.kuaidi.goods_number>0}}">当前快递含有{{item.kuaidi.goods_number}}个商品</view>
</view>
<view class="name" style="display: flex;">
<text>订单详情 您的订单总计{{sum}}件商品,本包裹发货{{item.goods_number}}件商品。请注意查验货品,如有疑问请及时联系我方客服。</text>
</view>
<view class="order_box {{item.open?'':'normalHeight'}}">
<view class="order_item" wx:for="{{item.kuaidi.Traces}}" wx:key="index">
<view class="time_box">
... ...
... ... @@ -8,21 +8,23 @@ Page({
success: false,
fail: false,
name: '',
choudanNum:0,
choudanNum: 0,
addressId: 0,
tel: '',
area: '',
address: '',
cover_type: false,
total:'',
info:{
address:{
address:'',
area:'',
id:'',
tel:'',
name:''
total: '',
payMent: '',
orderPayMent: '',
info: {
address: {
address: '',
area: '',
id: '',
tel: '',
name: ''
}
}
... ... @@ -36,16 +38,16 @@ Page({
let index = e.currentTarget.dataset.index
let id = e.currentTarget.dataset.id
let check = e.currentTarget.dataset.check
let coudan = this.data.coudan||[]
let coudan_arr = this.data.coudan_arr||[]
let coudan = this.data.coudan || []
let coudan_arr = this.data.coudan_arr || []
let price = e.currentTarget.dataset.price;
let price2 = e.currentTarget.dataset.price2;
if (type == 1) {
if(this.data.info.choudan*100<(price*100)){
if (this.data.info.choudan * 100 < (price * 100)) {
wx.showToast({
title: '当前剩余积分不足,请重新挑选',
icon:'none'
icon: 'none'
})
return
}
... ... @@ -58,7 +60,7 @@ Page({
}
}
if (num<1) {
if (num < 1) {
coudan.forEach((item, index) => {
if (item.id == id) {
coudan.splice(index, 1)
... ... @@ -66,7 +68,7 @@ Page({
}
})
} else {
if(type==1&&num==1){
if (type == 1 && num == 1) {
//选中
coudan.push({
id: id,
... ... @@ -76,9 +78,9 @@ Page({
id: id,
num: num,
price: Number(price),
price2:Number(price2)
price2: Number(price2)
})
}else{
} else {
coudan.forEach((item, index) => {
if (item.id == id) {
item.num = num
... ... @@ -104,19 +106,19 @@ Page({
for (let obj of coudan_arr) {
console.log(obj)
console.log(obj.price2)
if (obj.price2!= null) {
if (obj.price2 != null) {
console.log(111)
choudan_money = (obj.price2 * 100 * obj.num) / 100 + choudan_money
} else {
console.log(222)
choudan_money = (obj.price * 100 * obj.num) / 100 + choudan_money
}
num = num+obj.num
num = num + obj.num
}
this.setData({
choudan_money: choudan_money*100,
choudanNum:num,
choudan_money: choudan_money * 100,
choudanNum: num,
'info.choudan': this.data.info.syjf - choudan_money
// choudan_money: Math.floor(choudan_money* 100) / 100
})
... ... @@ -183,7 +185,7 @@ Page({
id: id,
num: num,
price: Number(price),
price2:Number(price2)
price2: Number(price2)
})
}
that.setData({
... ... @@ -204,7 +206,11 @@ Page({
app.post(url, params).then((res) => {
console.log('99999', res, Number(res.msg.total))
res.msg.syjf = res.msg.choudan - res.msg.yunfei
res.msg.choudan = res.msg.choudan - res.msg.yunfei
let a = (res.msg.choudan - res.msg.yunfei).toFixed(2)
if (a < 0) {
a = 0
}
res.msg.choudan = a
res.msg.total = Number(res.msg.total * 100)
res.msg.yunfei = Number(res.msg.yunfei * 100)
... ... @@ -213,10 +219,8 @@ Page({
that.setData({
info: res.msg,
total:total
total: total
})
console.log('9988756', that.data.info)
})
... ... @@ -233,12 +237,46 @@ Page({
}
app.post(url, params).then((res) => {
that.setData({
"info.yunfei": Number(res.msg.yunfei)*100
"info.yunfei": Number(res.msg.yunfei) * 100
})
})
},
// 支付失败弹窗关闭
payFail() {
this.setData({
fail: false
})
},
// 混合支付
mixedPay() {
let that = this
let url = app.interface.orderMixed
let params = {
order_odd: that.data.orderPayMent,
money: that.data.payMent
}
app.post(url, params).then((res) => {
wx.requestPayment({
timeStamp: res.data.timestamp,
nonceStr: res.data.nonceStr,
package: res.data.package,
signType: 'MD5',
paySign: res.data.paySign,
success(res) {
console.log(res,'支付成功')
that.setData({
fail: false
})
wx.showToast({
title: '支付成功',
})
},
fail(res) {
console.log(res,'支付失败')
}
})
})
},
//点击支付
submit() {
let that = this
... ... @@ -272,12 +310,16 @@ Page({
that.setData({
cover_type: false
})
that.setData({
orderPayMent: res.msg
})
that.order_pay(res.msg)
})
},
//订单支付
order_pay(order_odd) {
let that = this
let url = app.interface.order_pay
let params = {
order_odd: order_odd
... ... @@ -298,13 +340,18 @@ Page({
this.setData({
fail: true
})
let payMents = (that.data.info.total + that.data.info.yunfei) / 100 - that.data.order.syjf
that.setData({
payMent: payMents.toFixed(2)
})
console.log(payMents, 'payMent')
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
onLoad: function (options) {
console.log(options)
this.setData({
type: options.type,
... ... @@ -317,21 +364,21 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
onShow: function () {
let pages = getCurrentPages();
let currPage = pages[pages.length - 1]
console.log('887766554',currPage.data.id)
console.log('887766554', currPage.data.id)
if (currPage.data.id) {
console.log('4778785',this.data.info)
console.log('4778785', this.data.info)
this.setData({
"info.address.address": currPage.data.address,
... ... @@ -356,35 +403,35 @@ Page({
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
... ... @@ -37,14 +37,14 @@
</view>
<view class='re_bottom'>
<view class='re_re_name'>{{item.name}}</view>
<view class='re_re_score'wx:if="{{item.price!=null}}">{{item.price2}}积分</view>
<view class='re_re_score' wx:if="{{item.price!=null}}">{{item.price2}}积分</view>
<view class='re_re_score' wx:else>{{item.price}}积分</view>
</view>
<!-- 数量操作 -->
<view class="num_box">
<image class="num_btn" src="/images/reduce.png" data-check='{{item.check}}' wx:if="{{item.num}}" data-index="{{index}}" data-id="{{item.id}}" data-type="0" data-num="{{item.num?item.num:0}}" catchtap="num_change" data-price='{{item.price}}' data-price2="{{item.price2}}" />
<text wx:if="{{item.num}}" >{{item.num?item.num:0}}</text>
<text wx:if="{{item.num}}">{{item.num?item.num:0}}</text>
<image class="num_btn" src="/images/add.png" data-check='{{item.check}}' data-index="{{index}}" data-id="{{item.id}}" data-type="1" data-num="{{item.num?item.num:0}}" catchtap="num_change" data-price='{{item.price}}' data-price2="{{item.price2}}" />
</view>
</view>
... ... @@ -79,7 +79,7 @@
</view>
<view class="num">共{{info.totalnum + choudanNum}}件</view>
</view>
<concat/>
<concat />
<!-- 支付成功弹框开始 -->
<view class='success_mask' wx:if='{{success}}'>
... ... @@ -93,17 +93,67 @@
</view>
<!-- 支付成功弹框结束 -->
<!-- 支付失败弹框开始 -->
<view class='success_mask' wx:if='{{fail}}'>
<!-- <view class='success_mask' wx:if='{{fail}}'>
<view class='success_diceng'>
<view class='success_one'>
<image src='/images/icon_55.png'></image>
</view>
<view class='success_font'>支付失败</view>
<!-- status为1的时候才能支付 -->
status为1的时候才能支付
<view class='fail_font' wx:if="{{info.status == 0}}">不在活动时间,您不能支付</view>
<view class='fail_font' wx:else>所需积分{{order.xy}},积分余额{{order.syjf}}</view>
<navigator class='success_confirm_btn' open-type="navigateBack">取消支付</navigator>
</view>
</view> -->
<view class="peijianMask" wx-if="{{fail}}">
<view class="peijianPopup">
<view class="typePopop_quxiao" bindtap="payFail">
<image src="/images/quxiao11.png" mode="widthFix" style="width: 48rpx;"></image>
</view>
<view style="padding: 32rpx;margin-top: 80rpx;">
<view style="display: flex;flex-direction: column;align-items: center;">
<image src="/images/jinggao.png" mode="widthFix" style="width: 126rpx;"></image>
<text style="font-size: 32rpx; color: #000;margin: 16rpx 0;">支付失败</text>
<text style="font-size: 28rpx;">您的积分不足,可使用微信支付差价</text>
</view>
<view style="width: 100%;padding: 32rpx 0;display: flex;justify-content: space-between;border-bottom: 1rpx solid rgba(240,242,245,1);">
<view style="font-size: 28rpx;">
共需积分
</view>
<view style="font-size: 32rpx;color: #3D9BF5;">
{{order.xy}}
</view>
</view>
<view style="width: 100%;padding: 32rpx 0;display: flex;justify-content: space-between;border-bottom: 1rpx solid rgba(240,242,245,1);">
<view style="font-size: 28rpx;">
当前积分
</view>
<view style="font-size: 32rpx;color: #3D9BF5;">
{{order.syjf}}
</view>
</view>
<view style="width: 100%;padding: 32rpx 0;display: flex;justify-content: space-between;border-bottom: 1rpx solid rgba(240,242,245,1);">
<view style="font-size: 28rpx;">
差价支付
</view>
<view style="font-size: 32rpx;color: #ED261C;">
¥{{payMent}}
</view>
</view>
<view style="margin-top: 114rpx;display: flex;align-items: center;font-size: 28rpx;justify-content: space-between;">
<view>
<text style="color: rgba(0,0,0,0.26);">共{{info.totalnum + choudanNum}}件,</text>
<text style="color: rgba(0,0,0,0.6);">合计:</text>
<text style="color: #3D9BF5;">{{order.xy}}积分,</text>
<text style="color: rgba(0,0,0,0.6);">差价:</text>
<text style="color: #ED261C;">¥{{payMent}}</text>
</view>
<view style="width: 222rpx;height: 88rpx;background-color: #3D9BF5;border-radius: 96rpx;display: flex;align-items: center;justify-content: center;font-size: 32rpx;color: #FFFFFF;" bindtap="mixedPay">
提交
</view>
</view>
</view>
</view>
</view>
<!-- 支付失败弹框结束 -->
... ...
... ... @@ -479,3 +479,29 @@ page {
color: rgba(19, 26, 46, 1);
margin: 0 24rpx;
}
.peijianMask {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.4);
opacity: 1;
z-index: 999999;
}
.peijianPopup {
width: 100%;
border-radius: 32rpx 32rpx 0 0;
opacity: 1;
background-color: #FFFFFF;
position: absolute;
bottom: 0;
left: 0;
z-index: 999999;
}
.typePopop_quxiao {
position: absolute;
top: 32rpx;
right: 32rpx;
}
... ...
{
"description": "项目配置文件",
"packOptions": {
"ignore": []
"ignore": [],
"include": []
},
"setting": {
"urlCheck": false,
... ... @@ -25,6 +26,7 @@
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"ignoreDevUnusedFiles": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
... ... @@ -45,47 +47,30 @@
"libVersion": "2.22.0",
"appid": "wx73497072e7340d61",
"projectname": "binhaineigouopen",
"debugOptions": {
"hidedInDevtools": []
},
"isGameTourist": false,
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"plugin": {
"list": []
},
"game": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": [
{
"id": 0,
"name": "123",
"pathName": "pages/login/login",
"query": "",
"scene": null
},
{
"id": 1,
"name": "pages/shop_detail/shop_detail",
"pathName": "pages/order/order",
"query": "",
"scene": null
},
{
"id": 2,
"name": "公众号模拟",
"pathName": "pages/register/register",
"query": "",
"scene": 1058
},
{
"id": -1,
"name": "自定义菜单",
"pathName": "pages/register/register",
"query": "",
... ... @@ -95,63 +80,54 @@
}
},
{
"id": -1,
"name": "个人中心",
"pathName": "pages/my/my",
"query": "",
"scene": null
},
{
"id": -1,
"name": "商品列表",
"pathName": "pages/classify/classify",
"query": "",
"scene": null
},
{
"id": -1,
"name": "活动套餐",
"pathName": "pages/search/search_result/search_result",
"query": "",
"scene": null
},
{
"id": -1,
"name": "足迹",
"pathName": "pages/zuji/zuji",
"query": "",
"scene": null
},
{
"id": -1,
"name": "首页",
"pathName": "pages/index/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "注册",
"pathName": "pages/register/register",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/shop_detail/shop_detail",
"pathName": "pages/shop_detail/shop_detail",
"query": "id=774",
"scene": null
},
{
"id": -1,
"name": "pages/classify/classify",
"pathName": "pages/classify/classify",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/classify/classify",
"pathName": "pages/classify/classify",
"query": "",
... ... @@ -189,5 +165,9 @@
}
]
}
},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 4
}
}
\ No newline at end of file
... ...
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"libVersion": "2.25.0",
"condition": {
"miniprogram": {
"list": [
{
"name": "123",
"pathName": "pages/login/login",
"query": "",
"scene": null
},
{
"name": "pages/shop_detail/shop_detail",
"pathName": "pages/order/order",
"query": "",
"scene": null
},
{
"name": "公众号模拟",
"pathName": "pages/register/register",
"query": "",
"scene": 1058
},
{
"name": "自定义菜单",
"pathName": "pages/register/register",
"query": "",
"scene": 1035,
"referrerInfo": {
"appId": "wx017596efd78a16f0"
}
},
{
"name": "个人中心",
"pathName": "pages/my/my",
"query": "",
"scene": null
},
{
"name": "商品列表",
"pathName": "pages/classify/classify",
"query": "",
"scene": null
},
{
"name": "活动套餐",
"pathName": "pages/search/search_result/search_result",
"query": "",
"scene": null
},
{
"name": "足迹",
"pathName": "pages/zuji/zuji",
"query": "",
"scene": null
},
{
"name": "首页",
"pathName": "pages/index/index",
"query": "",
"scene": null
},
{
"name": "注册",
"pathName": "pages/register/register",
"query": "",
"scene": null
},
{
"name": "pages/shop_detail/shop_detail",
"pathName": "pages/shop_detail/shop_detail",
"query": "id=774",
"scene": null
},
{
"name": "pages/classify/classify",
"pathName": "pages/classify/classify",
"query": "",
"scene": null
},
{
"name": "pages/classify/classify",
"pathName": "pages/classify/classify",
"query": "",
"scene": null
},
{
"name": "确定顶",
"pathName": "pages/order/order",
"query": "type=3&info={\"shop_id\":12,\"num\":1}&id=12",
"scene": null
},
{
"name": "pages/shop_cart/shop_cart",
"pathName": "pages/shop_cart/shop_cart",
"query": "",
"scene": null
},
{
"name": "packageA/pages/index/index",
"pathName": "packageA/pages/index/index",
"query": "",
"scene": null
},
{
"name": "确认订单",
"pathName": "packageA/pages/order/order",
"query": "type=3&info={\"shop_id\":3232,\"num\":1}&id=3232",
"scene": null
},
{
"name": "packageA/pages/logistics/logistics",
"pathName": "packageA/pages/logistics/logistics",
"query": "order=K7J527500103601",
"scene": null
},
{
"name": "快递详情",
"pathName": "packageA/pages/logistics/logistics",
"query": "order=LBLAY890707802979",
"launchMode": "default",
"scene": null
}
]
}
}
}
\ No newline at end of file
... ...