Commit fbc7fbdb by 张晓玮

Merge branch 'dev_v4.19.0' into 'develop'

Dev v4.19.0

See merge request !58
2 parents cef440e7 a0b2ed7a
Showing 153 changed files with 4556 additions and 60 deletions
......@@ -148,6 +148,12 @@ module.exports = {
return api.post('dj.api.scenemerchantref.query4SRefByYqShop', data)
},
// 获取门店下的员工(推荐人)众筹场景
getStaffListByMerchantAPI(data) {
let params = data || {}
params.sceneList = [3]
return api.post('dj.api.smartcarlife.employee.getByMerchantId', params)
},
// 获取园区店配置
getYqStoreConfig(data) {
return api.get('dj.api.smarcarlife.yqMerchantConfig.detail', data)
......
//app.js
import router from './router/index.js'
// 初始化sentry
import sentryInit from '~/utils/sentryConfig/sentryInit'
sentryInit()
// 解决showLoading 和 showToast显示异常的问题
import fixWxShowToast from './utils/lib/fixWxShowToast'
fixWxShowToast()
import router from './router/index.js'
// 判断小程序是否需要更新
import getUpdateManager from './utils/lib/wxUpdateManager'
import util from './utils/util.js'
......@@ -10,20 +13,18 @@ import util from './utils/util.js'
import { Storage } from '~/utils/cache/storage'
const $Storage = new Storage()
import { setSystem_info } from '~/utils/cache/storageApi'
import { checkYqdSuper, setConfigInfo, checkScene } from '~/store/index'
setSystem_info() // 存储设备信息
import { checkYqdSuper, checkScene } from '~/store/index'
import eventbus from './utils/eventbus'
App({
onLaunch() {
/**挂载到wx对象 */
wx.$storage = $Storage /** 挂载全局缓存方法 */
// 存储设备信息
setSystem_info()
wx.$router = router
wx.$modal = this.showModal
wx.$util = util
wx.$eventbus = eventbus
// setConfigInfo(this.globalData)
let userInfo = util.getStorageSync('dj_boutique_user_info')
userInfo && checkYqdSuper(this.globalData, userInfo)
},
......@@ -33,30 +34,9 @@ App({
onShow(options) {
getUpdateManager()
// 如果是带参数的小程序码进入 会处理后把参数存到wx.$SCENE
// options.query.scene = 2 //调试用
// console.log(options, 'options')
// orderCode=2208241419054111&merchantId=44209480&customerName=123&page=createOrder
// let mockOptions = {
// query: {
// // orderCode: 2208241419054111,
// // merchantId: 44209480,
// customerName: '%E7%83%82%EC%A7%84%ED%9D%99%E6%B3%A5',
// page: 'createArchives'
// }
// }
// options = mockOptions
if (options) {
let query = options.query
if (query) {
// 解码
for (const key in query) {
query[key] = decodeURIComponent(query[key])
}
options.query = query
}
console.log('options', options)
// console.log('options', options)
let res = checkScene(options)
// console.log(res, 'res')
// 如果需要重新登录
......@@ -85,6 +65,10 @@ App({
}
})
} else {
this.globalData.yqdInfo = {}
this.globalData.YQorderSetting = ''
util.removeStorage()
wx.$relogin = relogin
router.reLaunch('pages.wxLogin')
}
},
......
......@@ -78,6 +78,11 @@
"root": "tabDate",
"name": "tabDate",
"pages": ["pages/index/index", "pages/detail/detail"]
},
{
"root": "packageCrowdFunding",
"name": "packageCrowdFunding",
"pages": ["pages/paidOrder/paidOrder", "pages/activityList/activityList", "pages/activityPay/activityPay", "pages/paymentSuccess/paymentSuccess", "pages/balanceNote/balanceNote", "pages/newOrder/newOrder", "pages/additionRecordOrder/additionRecordOrder"]
}
],
"usingComponents": {
......
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
// components/subShopMerchant/subShopMerchant.js
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
observer: function(n) {
if (n) {
let { copyArtificerList, orderInfo } = this.data
copyArtificerList.map(i => {
i.active = false
if (i.id == orderInfo?.technicianId) {
i.active = true
}
return i
})
this.setData({
artificerList: copyArtificerList,
selectedTechnicianId: orderInfo?.technicianId,
searchValue: ''
})
}
}
},
title: String,
orderInfo: Object,
copyArtificerList: Array
},
/**
* 组件的初始数据
*/
data: {
orderObj: {},
IMG_URL,
artificerList: [],
searchValue: ''
},
/**
* 组件的方法列表
*/
methods: {
search(e) {
let { copyArtificerList } = wx.$util.deepClone(this.data)
let { selectedTechnicianId } = this.data
let { value } = e.detail
if (!value) {
copyArtificerList.map(i => {
i.active = false
if (i.id == selectedTechnicianId) i.active = true
return i
})
this.setData({
artificerList: copyArtificerList
})
} else {
let arr = []
copyArtificerList.map(i => {
i.active = false
if (i.id == selectedTechnicianId) i.active = true
if (i.technicianName.indexOf(value) != -1) {
arr.push(i)
}
})
this.setData({
artificerList: arr
})
}
},
changeItem(e) {
let { target } = e.currentTarget.dataset
let { artificerList, copyArtificerList } = this.data
artificerList.map(i => {
i.active = false
if (i.id == target?.id) {
i.active = true
}
return i
})
copyArtificerList.map(i => {
i.active = false
if (i.id == target?.id) {
i.active = true
}
return i
})
this.setData({
artificerList: artificerList,
copyArtificerList: copyArtificerList,
selectedTechnicianId: target.id
})
},
cancel() {
let thisPage = wx.$router.getPageInstance()
thisPage.setData({
artificerSelectPopup: false
})
},
async confirm() {
let { copyArtificerList, orderInfo } = this.data
let arr = copyArtificerList?.filter(v => v.active) || []
if (!arr.length) {
return wx.$util.showToast('请选择技师')
}
orderInfo.technicianId = arr[0]?.id || ''
orderInfo.technicianName = arr[0]?.technicianName || ''
this.triggerEvent('confirm', orderInfo)
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<popup show="{{show}}" bindconfirm="confirm" bindcancel="cancel" height="60%">
<view class="artificer-select-popup-box" >
<view class="box">
<view class="sub-title text-center">{{title}}</view>
<view class="artificer-box">
<search-input bindsearch="search" value="{{searchValue}}" />
<view class="box-title">技师</view>
<scroll-view scroll-y style="height: calc(100% - 194rpx);" enhanced="{{true}}" show-scrollbar="{{false}}">
<block wx:for="{{artificerList}}" wx:key="index">
<view class="artificerList {{item.active?'active':''}}" bindtap="changeItem" data-target="{{item}}" data-index="{{index}}">
<view class="checked_img">
<image wx:if="{{item.active}}" src="{{IMG_URL}}checked.png"></image>
</view>
<view class="text_box"><view class="text-hide">{{item.technicianName}}</view></view>
</view>
</block>
</scroll-view>
</view>
</view>
</view>
</popup>
/* components/subShopMerchant/subShopMerchant.wxss */
.artificer-select-popup-box{
height: 100%;
width: calc(100% + 64rpx);
transform: translateX(-32rpx);
}
.sub-title {
height: 100rpx;
font-size: 32rpx;
color: #333333;
position: sticky;
left: 0;
top: 0;
background-color: #fff;
z-index: 2;
border-bottom: 2rpx solid #F9F9F9;
}
.text-hide {
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}
.text-center{
display: flex;
align-items: center;
justify-content: center;
}
.box{
height: 100%;
padding: 0 32rpx;
}
.artificer-box{
height: calc(100% - 102rpx);
overflow: hidden;
transition: all .25s;
}
.box-title{
color: #333333;
font-size: 32rpx;
height: 88rpx;
line-height: 88rpx;
}
.artificerList {
width: calc(100% - 50rpx);
height: 98rpx;
display: flex;
align-items: center;
font-size: 28rpx;
color: #999999;
padding: 0 25rpx;
transition: all .5s;
}
.checked_img{
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
margin-right: 20rpx;
}
.artificerList .text_box{
flex: 1;
border-bottom: 2rpx solid #F9F9F9;
height: 100%;
line-height: 98rpx;
}
.artificerList.active {
color: #3582EE;
font-weight: 700;
position: relative;
}
<view class='textarea-box {{maxlength>0&&showWordLimit?"showWordLimit":""}}'>
<block wx:if='{{edit}}'>
<text class='textarea' bindtap="openTextarea" style="color:{{value?'#282829':'#B1B1B3'}}">
{{value||placeholder||'请输入'}}
</text>
</block>
<block wx:else>
<textarea
class='_textarea_'
maxlength="{{customMaxLength?-1:maxlength}}"
value='{{value}}'
bindinput='textareaInput'
focus='{{textareaFocus}}'
bindblur='textareaBlur'
bindconfirm='textareaBlur' />
</block>
<block wx:if='{{maxlength>0&&showWordLimit}}'>
<view class='wordLimit'>{{value.length||0}} / {{maxlength}}</view>
</block>
</view>
<block wx:if='{{edit}}'>
<text class='textarea' bindtap="openTextarea"
style="color:{{value?'#282829':'#B1B1B3'}}; {{textStyle}}">{{value||placeholder||'请输入'}}</text>
</block>
<block wx:else>
<textarea class='_textarea_' maxlength="{{customMaxLength?-1:maxlength}}" value='{{value}}'
bindinput='textareaInput' focus='{{textareaFocus}}' bindblur='textareaBlur' bindconfirm='textareaBlur'></textarea>
</block>
<block wx:if='{{maxlength>0&&showWordLimit}}'>
<view class='wordLimit'>
{{value.length||0}} / {{maxlength}}
</view>
</block>
</view>
\ No newline at end of file
......@@ -5,7 +5,6 @@
min-height: 120rpx;
position: relative;
height: 100%;
line-height: 14rpx;
}
.textarea-box .textarea {
position: absolute;
......@@ -14,17 +13,17 @@
width: 100%;
height: 100%;
overflow-y: scroll;
/* line-height: 32rpx; */
line-height: 38rpx;
font-size: 32rpx;
word-break: break-all;
}
._textarea_ {
width: 100%;
line-height: 14rpx;
font-size: 32rpx;
color: #333333;
height: calc(100% - 40rpx);
}
.textarea-box.showWordLimit .textarea {
line-height: 14rpx;
height: calc(100% - 40rpx);
}
......
......@@ -34,6 +34,7 @@ Component({
this.setData({
show: false
})
this.triggerEvent('cancel')
},
confirm() {
this.triggerEvent('confirm')
......
......@@ -80,6 +80,8 @@ Component({
thisPage.setData({
[name]: false
})
// 组件中使用
this.triggerEvent('cancel')
this.setData({
isEdit: false
})
......
......@@ -10,7 +10,7 @@
* 2测试
* 3生产环境
*/
let index = 1
let index = 3
const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
......
......@@ -267,7 +267,7 @@ var getTime = function (date) {
this.select([date, null]);
}
else if (allowSameDay) {
this.select([date, date]);
this.select([date, date], true);
}
}
else {
......
......@@ -11,6 +11,7 @@ var link_1 = require("../mixins/link");
dot: Boolean,
info: String,
icon: String,
color: String,
classPrefix: {
type: String,
value: 'van-icon',
......
......@@ -27,6 +27,7 @@
name="{{ icon }}"
dot="{{ dot }}"
info="{{ info }}"
color="{{ color }}"
class-prefix="{{ classPrefix }}"
class="van-goods-action-icon__icon"
custom-class="icon-class"
......
@import '../common/index.wxss';.van-rate{display:inline-flex;-webkit-user-select:none;user-select:none}.van-rate__item{padding:0 var(--rate-horizontal-padding,2px);position:relative}.van-rate__item:not(:last-child){padding-right:var(--rate-icon-gutter,4px)}.van-rate__icon{color:var(--rate-icon-void-color,#c8c9cc);display:block;font-size:var(--rate-icon-size,20px);height:1em}.van-rate__icon--half{left:var(--rate-horizontal-padding,2px);overflow:hidden;position:absolute;top:0;width:.5em}.van-rate__icon--full,.van-rate__icon--half{color:var(--rate-icon-full-color,#ee0a24)}.van-rate__icon--disabled{color:var(--rate-icon-disabled-color,#c8c9cc)}
\ No newline at end of file
@import '../common/index.wxss';.van-rate{display:inline-flex;-webkit-user-select:none;user-select:none}.van-rate__item{padding:0 var(--rate-horizontal-padding,2px);position:relative}.van-rate__item:not(:last-child){padding-right:var(--rate-icon-gutter,4px)}.van-rate__icon{color:var(--rate-icon-void-color,#c8c9cc);display:block;font-size:var(--rate-icon-size,20px);height:100%}.van-rate__icon--half{left:var(--rate-horizontal-padding,2px);overflow:hidden;position:absolute;top:0;width:.5em}.van-rate__icon--full,.van-rate__icon--half{color:var(--rate-icon-full-color,#ee0a24)}.van-rate__icon--disabled{color:var(--rate-icon-disabled-color,#c8c9cc)}
\ No newline at end of file
......@@ -4,7 +4,7 @@ var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexport
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1678011309472, function(require, module, exports) {
__DEFINE__(1680600076295, function(require, module, exports) {
;(function (globalObject) {
......@@ -2933,7 +2933,7 @@ __DEFINE__(1678011309472, function(require, module, exports) {
})(this);
}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1678011309472);
return __REQUIRE__(1680600076295);
})()
//miniprogram-npm-outsideDeps=[]
//# sourceMappingURL=index.js.map
\ No newline at end of file
......@@ -4,7 +4,7 @@ var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexport
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1678011309473, function(require, module, exports) {
__DEFINE__(1680600076296, function(require, module, exports) {
module.exports = rfdc
......@@ -198,7 +198,7 @@ function rfdcCircles (opts) {
}
}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1678011309473);
return __REQUIRE__(1680600076296);
})()
//miniprogram-npm-outsideDeps=[]
//# sourceMappingURL=index.js.map
\ No newline at end of file
{
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"@vant/weapp": {
"version": "1.10.15",
"resolved": "https://registry.npmmirror.com/@vant/weapp/-/weapp-1.10.15.tgz",
"integrity": "sha512-swM4k3pVwt/6Tnijvq86paLiKE1CzbrBQ4lR7+9uRhwKOM0HS3ooK1Q4IjSEyxQ59ZFKmYYvZln77RZcnSDqmA=="
},
"bignumber.js": {
"version": "9.1.1",
"resolved": "https://registry.npmmirror.com/bignumber.js/-/bignumber.js-9.1.1.tgz",
"integrity": "sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig=="
},
"rfdc": {
"version": "1.3.0",
"resolved": "https://registry.npmmirror.com/rfdc/-/rfdc-1.3.0.tgz",
"integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA=="
}
}
}
import api from '~/utils/request/request.js'
module.exports = {
/** 查询活动列表 */
queryActivityList(data) {
let params = data || {}
return api.post('dj.api.smartcarlife.shopmallActivity.page', params)
},
// 查询子订单列表
queryTheListOfSuborders(data) {
let params = data || {}
return api.post('dj.api.smartcarlife.shopmallSubOrder.page', params)
},
// 活动统计
activityStatistics(data) {
let params = data || {}
return api.post('dj.api.smartcarlife.shopmallActivity.stat', params)
},
// 退款接口
markAsRefunded(data) {
let params = data || {}
return api.post('dj.api.smartcarlife.shopmallSubOrder.markAsRefunded', params)
},
// 交易流水号
transactionSerialNumber(data) {
let params = data || {}
return api.post('dj.api.smartcarlife.weapp.waitinputorder.page', params)
},
// 创建子订单(已收款补录订单)
createFullPayOrderAPI(data) {
return api.post('dj.api.smartcarlife.shopmallSubOrder.createFullPayOrder', data)
},
// 创建子订单(适用正常付尾款及关联尾款单)
createPayOrderAPI(data) {
return api.post('dj.api.smartcarlife.shopmallSubOrder.createPayOrder', data)
},
// 获取活动的商品信息
getMerchandiseInformation() {},
// 获取众筹活动商品
getSamePriceGoodsAPI(data) {
return api.post('dj.api.smartcarlife.shopmallActivity.selectSamePriceGoods', data)
},
/** 根据订单号获取订单详情 */
getOrderDetail(data) {
return api.post('dj.api.smartcarlife.order.detail', data)
},
/**改变支付订单状态 */
createPayOrder(data) {
return api.post('dj.api.smartcarlife.payOrder.create', data)
}
}
// packageEquity/pages/carEquity/components/GLForm/GLForm.js
Component({
options: {
multipleSlots: true // 在组件定义时的选项中启用多 slot 支持
},
/**
* 组件的属性列表
*/
properties: {
formData: {
type: Object,
value: () => {},
observer: function (n) {
this.setData({
formData: n
})
}
},
formDataList: {
type: Array,
value: () => []
},
labelWidth: {
type: String,
value: '140rpx'
},
// 页面存放表单对象的对象名,用于直接变更page的值
dataAttrName: {
type: String,
value: null
},
disable: {
type: Boolean,
value: false
}
},
/**
* 组件的初始数据
*/
data: {
targetIdx: -1
},
/**
* 组件的方法列表
*/
methods: {
getHeight(selector) {
return new Promise(resolve => {
wx.$util.getViewInfo(selector, res => {
return resolve(res)
}, this)
})
},
handleInput(e) {
let value = e.detail
let { attr } = e.target.dataset
let { dataAttrName } = this.data
let thisPage = wx.$router.getPageInstance()
thisPage.setData({
[dataAttrName + '.' + attr]: value
})
},
handlePickerChange(e) {
let idx = e.detail.value || 0
let { target } = e.currentTarget.dataset
let { dataAttrName } = this.data
let thisPage = wx.$router.getPageInstance()
thisPage.setData({
[dataAttrName + '.' + target.name]: target.optionList[idx][target.optionId],
[dataAttrName + '.' + target.labelName]: target.optionList[idx][target.optionLabel]
})
this.triggerEvent('pickerChange', { obj: target.optionList[idx] })
},
handleCellClick(e) {
let { target, idx } = e.currentTarget.dataset
switch (target.type) {
case 'outTradeNo':
this.setData({
targetIdx: idx
})
this.triggerEvent('showOrderNoPopup')
break
case 'select':
console.log(target)
this.triggerEvent('showPickerSelect', target)
break
default:
break
}
}
}
})
{
"component": true,
"usingComponents": {}
}
<!-- packageEquity/pages/carEquity/components/GLForm/GLForm.wxml -->
<view wx:for="{{formDataList}}" wx:key="index">
<gl-cell
border="{{!item.noBorder}}"
class="{{item.name}}"
haveArrow="{{item.haveArrow || false}}"
valueAlign="right"
label="{{item.label}}"
labelWidth="{{item.labelWidth || labelWidth}}"
placeholder="{{item.placeholder || ''}}"
bindclick="handleCellClick"
data-target="{{item}}"
data-idx="{{index}}"
cellHeight="{{!item.noCellHeight}}">
<!-- slot -->
<slot wx:if="{{item.type == 'slot'}}" name="{{item.name}}" />
<!-- input / textarea -->
<view wx:if="{{item.type == 'input'}}" class="input-box">
<!-- rows="1" -->
<van-field
class="textarea"
custom-style="padding: 20rpx 0;"
border="{{ false}}"
value="{{formData[item.name]}}"
input-align="{{itme.inputAlign || 'right'}}"
autosize
hold-keyboard
type="{{item.fieldType || 'text'}}"
placeholder="{{item.placeholder || '请输入'}}"
maxlength="{{item.maxlength || 140}}"
disabled="{{item.disabled||disable}}"
readonly="{{item.readonly}}"
data-attr="{{item.name}}"
bindinput="handleInput" />
<text wx:if="{{item.suffix}}" class="input-suffix">{{item.suffix}}</text>
</view>
<!-- 流水号 -->
<view wx:if="{{item.type == 'outTradeNo'}}" class="no_class">
<view wx:if="{{formData.outTradeNo}}" class="text-hide">
{{formData.outTradeNo}}
</view>
<view wx:else class="placeholder-class">{{item.placeholder || '请选择'}}</view>
</view>
<!-- picker -->
<view class="picker" wx:if="{{item.type == 'select'}}">
<image class="arrow" src="/components/images/arrow-x.png" />
<view class="text-hide" wx:if="{{formData[item.optionName]}}">
{{formData[item.optionName]}}
</view>
<text class="placeholder" wx:else>请选择</text>
</view>
</gl-cell>
</view>
/* packageEquity/pages/carEquity/components/GLForm/GLForm.wxss */
.input-box {
display: flex;
justify-content: space-between;
}
.textarea {
text-align: right;
font-size: 28rpx;
flex-grow: 1;
}
.input-suffix {
height: 88rpx;
line-height: 88rpx;
margin-left: 4rpx;
}
.placeholder-class {
color: #C3C3C3;
}
.picker {
display: flex;
flex-direction: row-reverse;
height: 80rpx;
line-height: 80rpx;
text-align: right;
}
.placeholder {
font-weight: 400;
font-size: 28rpx;
color: #B6B6B8;
}
.arrow {
width: 28rpx;
height: 26rpx;
margin-top: 26rpx;
flex-shrink: 0;
}
.text-hide {
font-size: 32rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.no_class {
text-align: right;
padding: 40rpx 0;
margin-left: 30rpx;
max-width: 100%;
}
\ No newline at end of file
// packageCrowdFunding/components/OrderNoPopup/OrderNoPopup.js
import api from '../../../api/api.js'
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
observer: function(n) {
if (n) {
this.getWaitinputorder()
}
}
},
title: String,
orderInfo: Object
},
/**
* 组件的初始数据
*/
data: {
itemFormObj: [
{
label: '交易参考号',
prop: 'outTradeNo'
}, {
label: '支付时间',
prop: 'accountDate'
}, {
label: '交易金额',
prop: 'totalFee',
type: 'price'
}
],
currentPage: 1,
pageSize: 10,
pages: '',
orderNoList: []
},
/**
* 组件的方法列表
*/
methods: {
// 选择交易流水号
changeOrderNo(e) {
let { target } = e.currentTarget.dataset
let { orderNoList } = this.data
orderNoList.map(i => {
i.active = false
if (i.outTradeNo && i.outTradeNo == target.outTradeNo) {
i.active = true
}
return i
})
this.setData({orderNoList})
},
restPageNum() {
this.setData({
currentPage: 1
})
this.getWaitinputorder()
},
scrollonReachBottom() {
let { pages, currentPage } = this.data
// 判断当前页是否是末页
if (pages == currentPage) return wx.$util.showToast('列表已到底')
this.setData({
currentPage: currentPage + 1
})
this.getWaitinputorder()
},
getWaitinputorder() {
let { currentPage, pageSize, orderNoList, orderInfo } = this.data
// totalFee 根据商品众筹价筛选交易流水号
api
.waitinputorder({ currentPage, pageSize, totalFee: orderInfo.totalFee})
.then(result => {
let { code, data } = result
if (code == 0) {
data.list.forEach(element => {
element.accountDate = new Date(element.accountDate).format('yyyy-MM-dd hh:mm:ss')
element.active = false
if (element.outTradeNo && element.outTradeNo == orderInfo.outTradeNo) {
element.active = true
}
})
this.setData({
orderNoList: currentPage == 1 ? data.list : [...orderNoList, ...data.list],
pages: data.pages,
triggered: false
})
}
})
.catch(err => {})
},
confirm() {
let { orderNoList, orderInfo } = this.data
let arr = orderNoList?.filter(v => v.active) || []
if (!arr.length) {
return wx.showToast({
title: '请选择交易参考号',
icon: 'none'
})
}
let thisPage = wx.$router.getPageInstance()
orderInfo.outTradeNo = arr[0]?.outTradeNo || ''
thisPage.setData({
orderInfo,
orderNoPopup: false
})
},
cancel() {
let thisPage = wx.$router.getPageInstance()
thisPage.setData({
orderNoPopup: false
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--packageCrowdFunding/components/OrderNoPopup/OrderNoPopup.wxml-->
<wxs src="index.wxs" module="filter" />
<popup show="{{show}}" bindconfirm="confirm" bindcancel="cancel" height="60%">
<view class="sub-title text-center">{{title}}</view>
<scroll-view
class="order_no_box"
scroll-y
enable-back-to-top
refresher-enabled="{{true}}"
bindrefresherrefresh="restPageNum"
bindscrolltolower="scrollonReachBottom"
refresher-threshold="104"
refresher-triggered="{{triggered}}">
<block wx:for="{{orderNoList}}" wx:key="index">
<view class="order_no_item {{item.active?'active':''}}" bindtap="changeOrderNo" data-target="{{item}}">
<view class="message">
<block wx:for="{{itemFormObj}}" wx:for-item="subItem" wx:key="idx">
<view class="item">
<view class="label">{{subItem.label}}</view>
<view class="value price_value" wx:if="{{subItem.type == 'price'}}">¥{{filter.priceFilter(item[subItem.prop])}}</view>
<view class="value" wx:else>{{item[subItem.prop]}}</view>
</view>
</block>
</view>
<view class="checked" wx:if="{{item.active}}">
<image src="../../../components/images/choose.png" />
</view>
</view>
</block>
</scroll-view>
</popup>
.sub-title {
height: 100rpx;
font-size: 32rpx;
color: #222222;
position: sticky;
left: 0;
top: 0;
background-color: #fff;
z-index: 2;
border-bottom: 1rpx solid #EDEDED;
}
.text-hide {
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}
.text-center{
display: flex;
align-items: center;
justify-content: center;
}
.order_no_box{
height: calc(100% - 100rpx);
}
.order_no_item{
height: 160rpx;
box-sizing: border-box;
background: #F7F8FA;
border-radius: 16rpx;
padding: 20rpx 32rpx;
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 20rpx;
}
.message{
display: flex;
flex-flow: column;
justify-content: center;
gap: 12rpx;
}
.checked{
width: 32rpx;
height: 32rpx;
}
.order_no_item.active{
background: #3582ee1a;
border: 2rpx solid #3582EE;
border-radius: 16rpx;
}
.order_no_item .item{
display: flex;
font-size: 24rpx;
color: #333333;
}
.item .label{
color: #9B9B9E;
width: 150rpx;
margin-right: 40rpx;
}
.item .price_value{
font-weight: 600;
}
var priceFilter = function (num) {
// 处理金额分转元并补零
var pow = Math.pow(10, 2)
return (Math.round(num / 100 * pow) / pow).toFixed(2)
}
module.exports = {
priceFilter: priceFilter
}
\ No newline at end of file
// packageCrowdFunding/components/PickerSelect/PickerSelect.js
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
observer: function(n) {
let { pickerObj, orderInfo } = this.data
orderInfo = wx.$util.deepClone(orderInfo)
if (n) {
pickerObj?.optionList?.map(i => {
i.active = false
if (i[pickerObj?.optionId] == orderInfo[pickerObj?.optionId]) {
i.active = true
}
return i
})
this.setData({
optionList: pickerObj?.optionList || []
})
}
}
},
title: String,
orderInfo: Object,
pickerObj: Object,
isAdditionRecordOrder: Boolean
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
changeitem(e) {
let { target } = e.currentTarget.dataset
let { optionList, pickerObj } = this.data
optionList.map(i => {
i.active = false
if (i[pickerObj?.optionId] == target[pickerObj?.optionId]) {
i.active = true
}
return i
})
this.setData({optionList})
},
confirm() {
let { optionList, orderInfo, pickerObj, title, isAdditionRecordOrder } = this.data
let arr = optionList?.filter(v => v.active) || []
if (!arr.length) {
return wx.showToast({
title: `请${title}`,
icon: 'none'
})
}
let thisPage = wx.$router.getPageInstance()
let copyOrderInfo = wx.$util.deepClone(orderInfo)
orderInfo[pickerObj.optionId] = arr[0][pickerObj.optionId] || ''
orderInfo[pickerObj.optionName] = arr[0][pickerObj.optionName] || ''
if (pickerObj.flag) { // 商品带出金额
// 定金金额
orderInfo['depositPrice'] = `¥${this.priceFilter(arr[0]?.activityPrice / 100 || 0)}`
// 尾款金额 = 众筹价 - 定金金额
orderInfo['tailPayment'] = `¥${this.priceFilter((arr[0]?.crowdFundingPrice - arr[0]?.activityPrice) / 100 || 0)}`
orderInfo['crowdFundingPrice'] = `¥${this.priceFilter(arr[0]?.crowdFundingPrice / 100 || 0)}`
// 筛选交易流水号 补录用订单总价 关联尾款单(有定金支付时间 用尾款 没有支付时间 用订单总价)
if (isAdditionRecordOrder) {
orderInfo['tailPayment'] = `¥${this.priceFilter(arr[0]?.crowdFundingPrice / 100 || 0)}`
orderInfo['totalFee'] = arr[0]?.crowdFundingPrice || 0
} else {
orderInfo['totalFee'] = (arr[0]?.crowdFundingPrice - arr[0]?.activityPrice) || 0
}
// 切换商品 清空选中的交易流水号
if (copyOrderInfo.goodsId !== arr[0][pickerObj.optionId]) orderInfo['outTradeNo'] = ''
// 特殊处理 一个id是众筹商品id 一个是嘀加智享车生活平台商品id
orderInfo.specialGoodsId = arr[0]?.goodsId
}
thisPage.setData({
orderInfo,
showPickerSelect: false
})
this.triggerEvent('confirm', orderInfo)
},
priceFilter(num) {
var pow = Math.pow(10, 2)
return (Math.round(num * pow) / pow).toFixed(2)
},
cancel() {
let thisPage = wx.$router.getPageInstance()
thisPage.setData({
showPickerSelect: false
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--packageCrowdFunding/components/PickerSelect/PickerSelect.wxml-->
<popup show="{{show}}" bindconfirm="confirm" bindcancel="cancel" height="60%">
<view class="sub-title text-center">{{title}}</view>
<scroll-view class="picker_select_box" scroll-y enhanced="{{true}}" show-scrollbar="{{false}}">
<block wx:for="{{optionList}}" wx:key="index">
<view class="picker_item {{item.active?'active':''}}" bindtap="changeitem" data-target="{{item}}">
<view class="checked">
<view class="checked_icon" hidden="{{!item.active}}">
<image src="../../../components/images/choose.png" />
</view>
</view>
<view class="value">
{{item[pickerObj.optionName] || ''}}
</view>
</view>
</block>
</scroll-view>
</popup>
/* packageCrowdFunding/components/PickerSelect/PickerSelect.wxss */
.sub-title {
height: 100rpx;
font-size: 32rpx;
color: #222222;
position: sticky;
left: 0;
top: 0;
background-color: #fff;
z-index: 2;
border-bottom: 1rpx solid #EDEDED;
}
.text-hide {
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}
.text-center{
display: flex;
align-items: center;
justify-content: center;
}
.picker_select_box{
height: calc(100% - 100rpx);
}
.picker_item{
width: 100%;
height: 104rpx;
display: flex;
align-items: center;
font-size: 32rpx;
border-bottom: 1rpx solid #F7F7F7;
}
.picker_item.active{
color: #3582EE;
}
.checked{
flex-shrink: 0;
width: 32rpx;
height: 32rpx;
margin-right: 24rpx;
}
.checked_icon{
width: 32rpx;
height: 32rpx;
}
.picker_item .value{
flex: 1;
}
import Api from '../../api'
import api from "../../api";
Component({
options: {
styleIsolation: 'apply-shared',
},
properties: {
activityId: {
type: String,
observer: function (n) {
if (n) {
this.init()
}
}
},
activityName: String
},
lifetimes: {
attached() {
this.setData({
userInfo: wx.$util.getUserInfo()
})
}
},
/**
* 页面的初始数据
*/
data: {
showRemark: false,
userInfo: {},
customerName: '',
navBarHeight: 100,
tabIndex: 0,
pageSize: 4,
pageNum: 1,
tabList: ['全部', '待支付', '已支付', '已退款'],
btnTxt: {
0: '去支付',
1: '去退款',
},
orderStatusObj: {
0: '待支付',
1: '已支付',
2: '已退款'
},
orderStatusList: [
{
confName: '全部',
confId: ''
}, {
confName: '待支付',
confId: '0'
}, {
confName: '已支付',
confId: '1'
},
{
confName: '已退款',
confId: '2'
}
],
subOrderCodeCopy: '',
searchObj: {},
flag: true,
statisticsObj: {},
orderObj: [
{
label: '活动名称',
key: 'activityName'
},
{
label: '推荐人',
key: 'referrer'
},
{
label: '转化人员',
key: 'transfer'
},
{
label: '商品名称',
key: 'goodsName'
},
{
label: '订金金额',
key: 'activityPrice',
type: 'price'
},
{
label: '订金支付时间',
key: 'payedDateStr'
},
{
label: '订单编号',
key: 'subOrderCode'
},
{
label: '尾款金额',
key: 'tailPayment',
type: 'price'
}
],
list: [],
isToBottom: false
},
methods: {
init() {
const {activityId} = this.data
Api.activityStatistics({activityId}).then(res => {
if (res.code == 0) {
this.setData({
statisticsObj: res.data
})
} else {
wx.$util.showToast(res.message || '接口异常')
}
})
},
onBottomRefresh() {
let { isToBottom } = this.data
if (isToBottom) return
this.setData({isToBottom: true})
this.getList()
},
remarkCancel() {
this.setData({
showRemark: false,
})
},
tabClick(e) {
let {searchObj} = this.data
delete searchObj.statusList
this.setData({
tabIndex: e?.detail,
searchObj
})
this.search()
},
handlefinalPayment(e) {
const {target} = e.currentTarget.dataset
wx.$router.go('balanceNote', {list: target})
},
getTotal() {
let {storeInfo} = this.data
getQuotationStatistics({merchantId: storeInfo?.merchantId}).then(res => {
// console.log(res, '统计---')
let {code, message} = res
let data = res.data ? {
...res.data,
} : {}
if (code == '0') {
this.setData({
statisticsObj: data
})
console.log(this.data.statisticsObj)
} else {
wx.$util.showToast(message || '接口异常')
}
})
},
getList(isReset = false) {
this.setData({
isToBottom: false
})
let {pageSize, pageNum, tabList, tabIndex, customerName, nothing, activityId, orderStatusList} = this.data
if (nothing) {
return
}
let params = {
pageSize,
pageNum,
customerName,
activityId,
tailOrderStatus: orderStatusList.find(item => item.confName == tabList[tabIndex])?.confId || '',
// merchantId: storeInfo?.merchantId
}
Api.queryTheListOfSuborders(params).then(res => {
if (res.code == '0') {
let {list, total} = res.data
list.forEach(val => {
val.payedDateStr = val.payedDate ? wx.$util.tsFormatTime(val.payedDate, 'Y年M月D日 h:m:s') : ''
val.tailPayedDateStr = val.tailPayedDate ? wx.$util.tsFormatTime(val.tailPayedDate, 'Y年M月D日 h:m:s') : ''
})
let tempList = isReset ? list : this.data.list.concat(list)
this.setData({
list: tempList,
pageNum: pageNum + 1,
total,
nothing: total == tempList.length,
triggered: false
})
if (isReset) {
this.setData({
scrollTop: 0
})
}
// console.log(this.data.list)
} else {
this.setData({
list: [],
nothing: false,
total: 0
})
wx.$util.showToast(res.message || '接口异常')
}
})
},
remarkConfirm(e) {
let value = e.detail
let refundRemark = value
const {subOrderCodeCopy} = this.data
let params = {
orderCode: subOrderCodeCopy,
refundRemark
}
Api.markAsRefunded(params).then(res => {
if (res.code == 0) {
console.log(res)
wx.$util.showToast('退款成功!')
this.getList()
} else {
wx.$util.showToast(res.message || '接口异常')
}
})
},
handleClickBtn(e) {
const {target} = e.currentTarget.dataset
console.log(target)
this.setData({
subOrderCodeCopy: target.subOrderCode
})
if (target.tailOrderStatus == 0) {
let {accountName} = wx.$util.getUserInfo()
const {goodsId: shopmallGoodsId, subOrderCode} = target
let params = {
subOrderCode,
orderPaySource: 1,
shopmallGoodsId,
selectPayType:1,
updatedBy: accountName
}
wx.$util.showLoading()
api.createPayOrderAPI(params).then(res => {
let {code, data, message} = res
wx.$util.hideLoading()
if (code == '0') {
// wx.$router.reLaunch
wx.$router.go('activityPay', {orderCode: target.subOrderCode, paramsActivityPrice: target.payedDate ? target.activityPrice : '', paramsActivityId: target.activityId, supplementOrderFlag: target.supplementOrderFlag})
} else {
wx.$util.showToast(message || '接口异常')
}
})
// wx.$router.go('activityPay',{orderCode:target.subOrderCode})
}
if (target.tailOrderStatus == 1) {
this.setData({
showRemark: true,
})
// wx.showModal({
// title: '温馨提示',
// content: '请确定将此订单状态标记为已退款',
// showCancel: true,
// confirmText: '确定',
// confirmColor: '#3582EE',
// success(res) {
// if (res.confirm) {
// Api.markAsRefunded({orderCode: subOrderCode}).then(res => {
// if (res.code == 0){
// console.log(res)
// wx.$util.showToast('退款成功!')
// this.getList()
// }else{
// wx.$util.showToast(res.message || '接口异常')
// }
// })
// }
// }
// })
}
},
search() {
this.setData({
pageNum: 1,
nothing: false,
total: 0
})
this.getList(true)
},
handleReset() {
this.setData({
customerName: ''
})
this.search()
},
input(e) {
let {value} = e.detail
this.setData({
customerName: value
})
},
back() {
wx.$router.back()
},
},
})
{
"component": true,
"usingComponents": {}
}
<wxs src="index.wxs" module="filter" />
<view class="headerBar">
<view class="totalCount">
<view class="left box">
<view class="label">今日产值</view>
<view class="num item">
<view class="labelStr">¥</view>
<view class="company">{{filter.priceFilter(statisticsObj.todayOutput || 0)}}</view>
<!-- <view class="decimal">.{{statisticsObj.todayTurDecimal}}</view>-->
</view>
<view class="count num">
今日成交量/单
<view class="countNum">{{statisticsObj.todayOrderNum || 0}}</view>
</view>
</view>
<view class="line" />
<view class="right box">
<view class="label">累计产值</view>
<view class="num item">
<view class="labelStr">¥</view>
<view class="company">{{filter.priceFilter(statisticsObj.output || 0)}}</view>
<!-- <view class="decimal">.{{statisticsObj.totalTurDecimal}}</view>-->
</view>
<view class="count num">
累计订单量/单
<view class="countNum">{{statisticsObj.orderNum || 0}}</view>
</view>
</view>
</view>
</view>
<!-- style="margin-top:{{navBarHeight}}px" -->
<view class="main">
<view class="to-box">
<view class="search-box">
<view class="search-input">
<image src="/images/search.png" class="search-icon" />
<input type="text" placeholder="请输入客户名字搜索" class="input" confirm-type="search" value="{{customerName}}" placeholder-class="input-placeholder" bindinput="input" bindconfirm="search" />
<block wx:if="{{customerName}}">
<image src="/images/clear.png" class="search-clear" bindtap="handleReset" />
</block>
</view>
</view>
<tab-bar tabList="{{tabList}}" bindclick="tabClick" />
</view>
<view class="total-box">
{{tabIndex == 0 ? '总订单' : tabList[tabIndex]}} · {{total}}
<view wx:if="{{tabIndex == 0}}" class="total-tips">
</view>
</view>
<view wx:if="{{flag}}" class="order-box">
<scroll-view scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="search" bindscrolltolower="onBottomRefresh" class="list" scroll-top="{{scrollTop}}" refresher-threshold="104" refresher-triggered="{{triggered}}">
<block wx:if="{{list.length > 0}}">
<view class="empty"></view>
<view wx:for="{{list}}" wx:key="index" class="item">
<view class="item-content">
<view class="item-header">
<view class="header-cust">
{{item.customerName}}
</view>
<view class="header-status">
<view wx:if="{{ item.tailOrderStatus =='1'}}">
<span class="green-txt">{{orderStatusObj[item.tailOrderStatus]}}</span>
<span class="header-price">¥{{filter.priceFilter(item.supplementOrderFlag == 1 ? (item.crowdFundingPrice) : (item.tailPayment || 0))}}</span>
</view>
<view wx:else class="{{item.tailOrderStatus == '2' ? 'red-txt' : '' }}">
{{orderStatusObj[item.tailOrderStatus] || '--'}}
</view>
</view>
</view>
<!-- 内容 -->
<view class="order-list" style="padding-bottom: {{item.tailOrderStatus != '2' && !userInfo.isSuper && userInfo.userType == 2 ? 0 : 20}}rpx">
<block wx:for="{{orderObj}}" wx:key="sindex" wx:for-index="sindex" wx:for-item="i">
<block >
<view class="order">
<view class="order-label">{{i.label}} </view>
<view class="order-value">
<block wx:if="{{i.type == 'price' && item[i.key]}}">¥{{filter.priceFilter(item[i.key])}}</block>
<block wx:else>{{item[i.key] || ''}}</block>
</view>
</view>
</block>
</block>
<view class="order" wx:if="{{item.tailOrderStatus == 1}}">
<view class="order-label">尾款支付时间 </view>
<view class="order-value">
<block>{{item['tailPayedDateStr']}}</block>
</view>
</view>
<view class="order" wx:if="{{item.tailOrderStatus == 2}}">
<view class="order-label">退款原因 </view>
<view class="order-value">
<block>{{item['refundRemark']}}</block>
</view>
</view>
</view>
</view>
<!-- footer -->
<!-- 超管isSuper/商户号类型 userType 2(员工号)账号不可操作 -->
<view class="item-footer" wx:if="{{item.tailOrderStatus != '2' && !userInfo.isSuper && userInfo.userType == 2}}">
<view wx:if="{{item.tailOrderStatus == '0'}}" class="order-btn default-btn mar-btn" bindtap="handlefinalPayment" data-target="{{item}}">
关联尾款单
</view>
<view class="order-btn" bindtap="handleClickBtn" data-target="{{item}}">
{{btnTxt[item.tailOrderStatus]}}
</view>
</view>
</view>
<block wx:if="{{nothing}}">
<view class="list-nothing">到底了~</view>
</block>
</block>
<view class="no-data" wx:else>
<image class="no-data-img" src="/packageCrowdFunding/images/noData.png" />
<view class="list-not">暂无数据</view>
</view>
</scroll-view>
</view>
</view>
<remark-popup wx:if="{{showRemark}}"
title="退款备注"
show="{{showRemark}}"
required="{{true}}"
maxlength="15"
bindcancel="remarkCancel"
bindconfirm="remarkConfirm"
placeholder="请填写退款备注" />
.main {
margin-top: -20rpx;
background: #FFFFFF;
border-radius: 48rpx 48rpx 0 0;
overflow: hidden;
height: calc(100% - 260rpx);
}
.to-box {
position: sticky;
left: 0;
z-index: 2;
/* box-shadow: 0 4rpx 20rpx 0 rgba(0, 0, 0, 0.10); */
}
.search-box {
width: 100%;
padding: 32rpx 32rpx 0;
display: flex;
background-color: #fff;
position: sticky;
top: 0;
left: 0;
z-index: 9;
box-sizing: border-box;
}
.search-box .search-input {
background: #F7F8FA;
border-radius: 38rpx;
width: 100%;
height: 72rpx;
display: flex;
align-items: center;
}
.search-box .search-input .search-icon {
width: 28rpx;
height: 28rpx;
margin: 0 10rpx 0 26rpx;
}
.search-box .search-input .search-clear {
width: 36rpx;
height: 36rpx;
margin: 0 26rpx 0 10rpx;
}
.search-box .search-input .input {
font-size: 28rpx;
width: calc(100% - 136rpx);
}
.input-placeholder {
color: rgba(200, 201, 204, .89);
}
.search-box .search {
width: 144rpx;
height: 100%;
color: #666;
box-sizing: border-box;
padding: 0 24rpx;
}
.search-box .search .text-center {
font-size: 24rpx;
/* background-color: #f7f7f7; */
border-radius: 12rpx;
width: 100%;
height: 50rpx;
color: #888;
}
.search-box .search .text-center .search-filter {
margin-left: 6rpx;
width: 24rpx;
height: 24rpx;
}
.total-box {
display: flex;
padding: 24rpx 30rpx;
font-weight: 400;
font-size: 28rpx;
color: #222222;
}
.total-tips {
font-size: 26rpx;
color: #6C6C70;
margin-left: 24rpx;
}
.order-box {
background-color: #fdfdfd;
height: calc(100% - 104rpx - 104rpx - 52rpx - 20rpx);
}
.list {
box-sizing: border-box;
width: 100%;
padding: 0 20rpx;
padding-bottom: 0;
/* height: calc(100% - 20rpx); */
height: calc(100% - 60rpx);
/* height: 100%; */
}
.list .empty{
width: 100%;
height: 20rpx;
background-color: transparent;
}
.list .item {
box-sizing: border-box;
background: #FFFFFF;
box-shadow: 0 6rpx 16rpx 0 rgba(205, 205, 209, 0.5);
border-radius: 16rpx;
margin: 0 6rpx 20rpx;
}
/* .list .item:first-child {
margin-top: 20rpx;
} */
.item .item-content {
padding: 20rpx 32rpx 0;
}
.list .item-header {
display: flex;
justify-content: space-between;
}
.item-header .header-cust {
display: flex;
align-items: center;
font-size: 32rpx;
color: #333333;
}
.list .icon-sex {
width: 24rpx;
height: 24rpx;
margin-left: 12rpx;
}
.list .header-status {
font-weight: 500;
font-size: 28rpx;
color: #FF9D0A;
}
.header-price {
color: #222222;
margin-left: 12rpx;
}
.green-txt {
color: #4AC18E;
}
.red-txt {
color: #EB4E4E;
}
.list .content {
width: 100%;
margin-right: 0;
-webkit-transition: all 0.4s;
transition: all 0.4s;
-webkit-transform: translateX(72px);
transform: translateX(72px);
margin-left: -72px;
}
.list .item .name {
display: flex;
align-items: center;
margin-bottom: 40rpx;
}
.list .item.gray .name {
color: #999999;
}
.list .item .name image {
width: 46rpx;
height: 46rpx;
}
.list .item.gray .name image {
filter: grayscale(100%);
}
.list .item .name .name-text {
margin-left: 26rpx;
width: 404rpx;
}
.list .item .goods-list {
padding-bottom: 20rpx;
border-bottom: 1rpx solid rgba(195, 195, 195, .29);
}
.list .item .goods-list .goods {
display: flex;
align-items: center;
padding-left: 32rpx;
/* margin-bottom: 20rpx; */
position: relative;
justify-content: space-between;
}
.list .item .goods-list .goods:nth-child(n+2) {
margin-top: 20rpx;
}
.list .item .goods-list .goods::after {
position: absolute;
width: 12rpx;
height: 12rpx;
top: 50%;
left: 0;
transform: translateY(-50%);
content: '';
background: #3582EE;
border-radius: 100%;
}
.list .item .goods-list .goods .goods-name {
font-size: 28rpx;
color: #3582EE;
max-width: 430rpx;
}
.list .item.gray .goods-list .goods .goods-name {
color: #666666;
}
.list .item.gray .goods-list .goods::after {
background: #666;
}
.list .item .goods-list .goods .goods-price {
font-size: 20rpx;
color: #666666;
display: flex;
align-items: baseline;
}
.list .item .goods-list .goods .goods-price text {
font-size: 24rpx;
color: #2A2A2A;
}
.list .item .goods-more {
padding-left: 32rpx;
font-size: 24rpx;
color: #888888;
display: flex;
align-items: center;
}
.list .item .goods-more text {
font-size: 28rpx;
color: #3582EE;
margin-right: 20rpx;
}
.list .item.gray .goods-more text {
color: #666;
}
.list .item .order-list {
padding: 20rpx 0 0;
margin-bottom: 24rpx;
}
.list .item .order-detail {
display: flex;
align-items: center;
background: #F4F5F7;
border-radius: 8rpx;
padding: 16rpx;
font-weight: 400;
font-size: 24rpx;
color: #222222;
margin-bottom: 24rpx;
}
.order-detail .detail-item {
width: 33%;
text-align: center;
border-right: 1rpx solid #E1E2E6;
}
.detail-item .detail-label {
color: #9B9B9E;
margin-bottom: 8rpx;
}
.order-detail .detail-item:last-child {
border: none;
}
.item-footer {
display: flex;
justify-content: flex-end;
/* margin-left: 200rpx; */
align-items: center;
font-size: 24rpx;
color: #9B9B9E;
border-top: 1rpx solid #EDEDED;
padding: 20rpx 32rpx;
}
.orange-txt {
color: #EB9B2F;
}
.icon-info {
width: 28rpx;
height: 28rpx;
margin-right: 8rpx;
vertical-align: middle;
}
.order-btn {
box-sizing: border-box;
height: 56rpx;
font-size: 28rpx;
color: #FFFFFF;
background: #3582EE;
border-radius: 32rpx;
padding: 8rpx 40rpx;
}
.mar-btn{
margin-right: 15rpx;
}
.order-btn.default-btn {
background: #FFFFFF;
border: 2rpx solid #3582EE;
border-radius: 32rpx;
color: #3582EE;
}
.list .item .order {
font-size: 24rpx;
color: #333333;
margin-bottom: 20rpx;
display: flex;
align-items: center;
}
.list .item .order:last-of-type {
margin-bottom: 0;
}
.list .item .order .order-label {
width: 165rpx;
color: #9B9B9E;
}
.list .item .order .order-value {
width: calc(100% - 136rpx);
display: flex;
align-items: center;
}
.list .item .order .order-value .order-value-item:first-of-type {
max-width: 70%;
}
.list .item .order .order-value .order-value-item .split {
margin: 0 6rpx;
}
.list .item .order-price {
display: flex;
justify-content: flex-end;
/* align-items: center; */
align-items: flex-end;
font-size: 24rpx;
color: #666666;
/* padding-top: 8rpx; */
}
.list .item .order-price .price {
box-sizing: border-box;
color: #F24724;
font-size: 40rpx;
margin-left: 20rpx;
margin-bottom: -8rpx;
/* margin-top: 8rpx; */
}
.list .item.gray .order-price .price {
color: #666 !important;
}
.list .item .order-price .price .unit {
font-size: 28rpx;
}
.list .item .order-payType {
font-size: 24rpx;
color: #333333;
/* margin-top: 50rpx; */
display: flex;
justify-content: space-between;
align-items: flex-end;
}
.list .item .btn {
border: 2rpx solid #666666;
border-radius: 12rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #666666;
position: absolute;
right: 40rpx;
bottom: 30rpx;
width: 192rpx;
height: 64rpx;
}
.no-data {
text-align: center;
padding-top: 128rpx;
}
.no-data-img {
width: 160rpx;
height: 160rpx;
}
.list-nothing,
.list-not {
text-align: center;
}
var priceFilter = function (num) {
// 处理金额分转元并补零
var pow = Math.pow(10, 2)
return (Math.round(num / 100 * pow) / pow).toFixed(2)
}
module.exports = {
priceFilter: priceFilter
}
\ No newline at end of file
Component({
/**
* 组件的属性列表
*/
options: {
styleIsolation: 'apply-shared'
},
properties: {
orderInfo: {
type: Object
},
OderType: {
type: String
}
},
/**
* 组件的初始数据
*/
data: {
list: [
{
labelName: '客户名称',
key: 'customerName'
},
{
labelName: '推荐人',
key: 'employeeName'
},
{
labelName: '活动名称',
key: 'activityName'
},
{
labelName: '商品名称',
key: 'goodsName'
},
{
labelName: '订金金额',
key: 'depositPrice'
},
{
labelName: '订金支付时间',
key: 'payDate',
}
]
},
/**
* 组件的方法列表
*/
methods: {}
})
.orderInfoCom {
box-sizing: border-box;
width: 710rpx;
padding: 32rpx 40rpx;
margin: 20rpx 0;
display: flex;
flex-direction: column;
// height: 492rpx;
background: #FFFFFF;
box-shadow: 0 6rpx 16rpx 0 #cdcdd159;
border-radius: 16rpx;
.title {
font-weight: 500;
font-size: 32rpx;
color: #333333;
line-height: 48rpx;
margin-bottom: 24rpx;
}
}
.info {
.item {
display: flex;
width: 100%;
font-size: 24rpx;
color: #222222;
line-height: 32rpx;
margin-bottom: 15rpx;
.label {
width: 150rpx;
min-width: 150rpx;
font-weight: 400;
font-size: 24rpx;
color: #9B9B9E;
line-height: 32rpx;
}
.goodsItem {
font-size: 24rpx;
color: #9B9B9E;
margin-top: 4rpx;
}
}
}
<wxs src="../../index.wxs" module="filter" />
<view class="orderInfoCom">
<view class="title">订单信息</view>
<view class="info">
<block wx:for="{{list}}" wx:key="index">
<view class="item" wx:if="{{item.orderType=='success'&&OderType=='detail'}}">
<view class="label">{{item.labelName}}</view>
<view class="text">
{{ item.key==goodsName?filter.replaceItemText(orderInfo[item.key]):orderInfo[item.key] ||''}}
</view>
</view>
<view class="item" wx:if="{{item.orderType!='success'}}">
<view class="label">{{item.labelName}}</view>
<view class="text" style="color:{{orderInfo.payOrder[item.key]==2?'#4AC18E':'#FF6601'}}" wx:if="{{item.key == 'payStatus'}}">
{{orderInfo.payOrder[item.key]==2?'已支付':'待支付'}}
<!-- test -->
</view>
<view class="text" wx:elif="{{item.type == 'project' }}">
<view class="goodsName">{{orderInfo.subOrderList[0].upgradeGoodsName}}</view>
<view class="goodsItem">包含{{orderInfo.subOrderList[0].serviceItems}}</view>
</view>
<view class="text" wx:else>{{orderInfo[item.key]||''}}</view>
</view>
</block>
</view>
</view>
const activityList = [
{
id:1,
activityName: '你猜我是什么活动',
realStartTime: '2023.03.01 16:30:15',
activityStatus: 1,
payedCount: 999,
notPayedCount:111,
activityImg:'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/scene_type_3.png'
},
{
id:2,
activityName: '不猜',
realStartTime: '2023.02.01 16:30:15',
activityStatus: 2,
payedCount: 2,
notPayedCount:88,
activityImg:'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/scene_type_3.png'
},
{
id:3,
activityName: '猜猜',
realStartTime: '2023.05.02 16:30:15',
activityStatus: 3,
payedCount: 2,
notPayedCount:32,
activityImg:'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/scene_type_3.png'
}
]
export default {
activityList
}
// import activityList from './constant/data'
import activityApi from '../../api'
Component({
/**
* 页面的初始数据
*/
data: {
searchObj: {},
activityName: '',
list: [],
tabIndex: 0,
nothing: false,
pageSize: 6,
pageNum: 1,
total: 0,
tabList: ['全部', '进行中', '待开始', '已结束'],
activityStatusList: [
{
confName: '全部',
confId: ''
},
{
confName: '待开始',
confId: '1'
},
{
confName: '进行中',
confId: '2'
},
{
confName: '已结束',
confId: '3'
}
]
},
properties: {
navBarHeight: Number
},
lifetimes: {
attached() {
this.setData({
storeInfo: wx.$util.getUserInfo()?.default4SStoreInfo_crowdFunding || {},
userInfo: wx.$util.getUserInfo() || {}
})
this.onLoad(true)
}
},
methods: {
onLoad(noGetList) {
this.setData({
nothing: false,
pageNum: 1,
storeInfo: wx.$util.getUserInfo()?.default4SStoreInfo_crowdFunding || {}
})
if (!noGetList) this.getActivityList(true)
},
onBottomRefresh() {
this.getActivityList()
},
getActivityList(isReset = false) {
let { pageSize, pageNum, activityName, storeInfo, nothing, tabIndex, activityStatusList, tabList } = this.data
if (nothing) {
return
}
let params = {
pageSize,
pageNum,
activityName,
activityStatus: activityStatusList.find(item => item.confName == tabList[tabIndex])?.confId || '',
merchantId: storeInfo?.merchantId
}
activityApi.queryActivityList(params).then(res => {
if (res.code == '0') {
let { list, total } = res.data
let tempList = isReset ? list : this.data.list.concat(list || [])
this.setData({
list: tempList,
pageNum: pageNum + 1,
total,
nothing: total == tempList.length,
triggered: false
})
if (isReset) {
this.setData({
scrollTop: 0
})
}
} else {
this.setData({
list: [],
nothing: false,
total: 0
})
wx.$util.showToast(res.message || '接口异常')
}
})
},
search() {
this.setData({
pageNum: 1,
nothing: false,
total: 0
})
this.getActivityList(true)
},
handleReset() {
this.setData({
activityName: ''
})
this.search()
},
input(e) {
let { value } = e.detail
this.setData({
activityName: value
})
},
// 首次进入会触发该方法,因此不需要在attached调getList
tabClick(e) {
let { searchObj } = this.data
this.setData({
tabIndex: e?.detail,
searchObj
})
this.search()
},
handleOrderList(e) {
const { target } = e.target.dataset
wx.$router.go('activityList', {
activityId: target.id,
activityName: target.activityName
})
},
back() {
wx.$router.reLaunch('pages.sceneIndex')
}
}
})
{
"component": true,
"usingComponents": {}
}
<view class="layout" style="padding-top:{{navBarHeight}}px;position: relative;">
<block>
<view class="main">
<view class="to-box">
<view class="search-box">
<view class="search-input">
<image src="/images/search.png" class="search-icon"/>
<input type="text" placeholder="请输入活动名称搜索" class="input" confirm-type="search"
value="{{activityName}}" placeholder-class="input-placeholder" bindinput="input"
bindconfirm="search"/>
<block wx:if="{{activityName}}">
<image src="/images/clear.png" class="search-clear" bindtap="handleReset"/>
</block>
</view>
</view>
<tab-bar tabList="{{tabList}}" bindclick="tabClick"/>
</view>
</view>
</block>
</view>
<block>
<scroll-view
scroll-y
enable-back-to-top
refresher-enabled="{{true}}"
bindrefresherrefresh="search"
bindscrolltolower="onBottomRefresh"
class="list"
style="height:calc(100vh - {{navBarHeight}}px - 208rpx);"
refresher-threshold="104"
refresher-triggered="{{triggered}}">
<block wx:if="{{list.length > 0}}">
<block>
<view class="empty"></view>
<block wx:for="{{list}}" wx:key="index">
<view class="activity-box">
<view class="activity-name">
<view class="activity-avatar">
<image src="{{item.activityImg}}" />
</view>
<view class="activity-status">
<view class="left">
<view class="name">{{item.activityName}}</view>
<view class="time">
<text style="width: 100rpx;flex-shrink: 0;">活动时间:</text>
<view wx:if="{{item.startTime && item.endTime}}">
<text>{{item.startTime || ''}}</text>
<text> 至 </text>
<text>{{item.endTime}}</text>
</view>
</view>
</view>
<view class="status status-green" wx:if="{{item.activityStatus == 2}}">
进行中
</view>
<view class="status status-red" wx:if="{{item.activityStatus == 3}}">
已结束
</view>
<view class="status status-yellow" wx:if="{{item.activityStatus == 1}}">
待开始
</view>
</view>
</view>
<view class="activity-list">
<view class="activity-pay">
<view class="havePaid">已支付·
<view class="havePaidSum">{{item.payedCount}}</view>
</view>
<view class="unpaid">待支付·
<view class="unpaidNum">{{item.notPayedCount}}</view>
</view>
</view>
<view class="orderListBtn" bindtap="handleOrderList" data-target="{{item}}"> 订单列表</view>
</view>
</view>
</block>
</block>
<block wx:if="{{nothing}}">
<view class="list-nothing">到底了~</view>
</block>
</block>
<view class="no-data" wx:else>
<image class="no-data-img" src="/packageCrowdFunding/images/noData.png" />
<view class="list-not">暂无数据</view>
</view>
</scroll-view>
</block>
.headerBar {
position: relative;
width: 100%;
height: 212rpx;
background-image: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/equity/equityBg.png');
background-size: 100% 100%;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.headerBar .totalCount {
box-sizing: border-box;
width: 100%;
display: flex;
align-items: center;
box-sizing: border-box;
padding: 16rpx 32rpx 32rpx;
font-size: 24rpx;
color: #6C6C70;
}
.headerBar .totalCount .item {
/* display: flex; */
box-sizing: border-box;
position: relative;
height: 144rpx;
width: 33%;
background: #FFFFFF;
box-shadow: 0 6rpx 24rpx 0 #caccdb80;
border-radius: 16rpx;
padding: 20rpx 24rpx;
margin-right: 16rpx;
}
.totalCount .total-icon {
position: absolute;
top: 2rpx;
right: 4rpx;
width: 88rpx;
height: 88rpx;
}
.headerBar .totalCount .item:last-child {
margin: 0;
}
.headerBar .totalCount .num {
height: 64rpx;
line-height: 64rpx;
font-size: 48rpx;
color: #222222;
font-weight: 600;
margin-top: 8rpx;
}
/* .headerBar .totalCount .item {
margin: 25rpx 0 25rpx;
} */
.headerBar .totalCount .company {
font-size: 48rpx;
}
.headerBar .totalCount .line {
width: 2rpx;
height: 116rpx;
background: #ffffff59
}
.headerBar .totalCount .countNum {
font-size: 34rpx;
font-weight: 500;
margin-left: 15rpx;
}
.headerBar .totalCount .labelStr {
margin-right: 5rpx;
}
.headerBar .totalCount .right {
margin-left: 40rpx;
}
.main {
margin-top: -20rpx;
background: #FFFFFF;
border-radius: 48rpx 48rpx 0 0;
overflow: hidden;
height: calc(100% - 192rpx);
}
.to-box {
position: sticky;
left: 0;
z-index: 2;
/* box-shadow: 0 4rpx 20rpx 0 rgba(0, 0, 0, 0.10); */
}
.search-box {
width: 100%;
padding: 32rpx 32rpx 0;
display: flex;
background-color: #fff;
position: sticky;
top: 0;
left: 0;
z-index: 9;
box-sizing: border-box;
}
.search-box .search-input {
background: #F7F8FA;
border-radius: 38rpx;
width: 100%;
height: 72rpx;
display: flex;
align-items: center;
}
.search-box .search-input .search-icon {
width: 28rpx;
height: 28rpx;
margin: 0 10rpx 0 26rpx;
}
.search-box .search-input .search-clear {
width: 36rpx;
height: 36rpx;
margin: 0 26rpx 0 10rpx;
}
.search-box .search-input .input {
font-size: 28rpx;
width: calc(100% - 136rpx);
}
.input-placeholder {
color: rgba(200, 201, 204, .89);
}
.search-box .search {
width: 144rpx;
height: 100%;
color: #666;
box-sizing: border-box;
padding: 0 24rpx;
}
.search-box .search .text-center {
font-size: 24rpx;
/* background-color: #f7f7f7; */
border-radius: 12rpx;
width: 100%;
height: 50rpx;
color: #888;
}
.search-box .search .text-center .search-filter {
margin-left: 6rpx;
width: 24rpx;
height: 24rpx;
}
.list{
box-sizing: border-box;
}
.empty{
width: 100%;
height: 20rpx;
background-color: transparent;
}
.activity-box {
margin: 0 20rpx 20rpx;
padding-top: 20rpx;
padding-bottom: 20rpx;
box-shadow: 0 4rpx 20rpx 0 rgba(0, 0, 0, 0.10);
border-radius: 16rpx;
z-index: 100;
}
.activity-box .activity-name {
display: flex;
padding-left: 35rpx;
padding-bottom: 20rpx;
/*justify-content: space-around;*/
}
.activity-box .activity-name .activity-avatar {
width: 150rpx;
height: 150rpx;
}
.activity-box .activity-name .activity-status {
width: 70%;
display: flex;
justify-content: space-between;
padding-top: 15rpx;
margin: 0rpx 20rpx;
}
.activity-box .activity-name .activity-status .left{
width: calc(100% - 100rpx);
}
.activity-box .activity-name .activity-status .name {
font-size: 30rpx;
width: 300rpx;
}
.activity-box .activity-name .activity-status .time {
font-size: 20rpx;
color: #9B9B9E;
margin-top: 25rpx;
display: flex;
}
.activity-box .activity-name .activity-status .status {
font-size: 30rpx;
/* padding-left: 60rpx; */
}
.status-green {
color: #4AC18E;
}
.status-red {
color: #EB4E4E;
}
.status-yellow {
color: #FF9D0A;
}
.activity-box .activity-list {
border-top: 1rpx solid #C3C3C3;
margin-top: 15rpx;
padding: 20rpx 40rpx 0 35rpx;
display: flex;
justify-content: space-between;
}
.activity-box .activity-list .orderListBtn {
color: #fff;
background: #3582EE;
width: 200rpx;
height: 60rpx;
font-size: 30rpx;
text-align: center;
line-height: 60rpx;
border-radius: 16px;
}
.activity-box .activity-list .activity-pay {
display: flex;
align-items: center;
}
.activity-box .activity-list .activity-pay .havePaid {
display: flex;
}
.activity-box .activity-list .activity-pay .havePaid .havePaidSum {
color: #FF9D0A;
}
.activity-box .activity-list .activity-pay .unpaid {
display: flex;
margin-left: 25rpx;
}
.activity-box .activity-list .activity-pay .unpaid .unpaidNum {
color: #EB4E4E;
}
.no-data {
text-align: center;
padding-top: 128rpx;
}
.no-data-img {
width: 160rpx;
height: 160rpx;
}
.list-nothing,
.list-not {
text-align: center;
}
Component({
properties: {
show: {
type: Boolean,
},
activityName:{
type:String
},
activityId:{
type:String
}
},
data: {
optionList:[
{name:'未收款新增订单',active:false,type:'outstandingCollection',url:'newOrder'},
{name:'已收款补录订单',active:false,type:'paymentHasBeenReceived',url:'additionRecordOrder'}
]
},
methods: {
changeitem(e) {
let { target } = e.currentTarget.dataset
let { optionList } = this.data
optionList.map(i => {
i.active = false
if (i.type == target.type) {
i.active = true
}
return i
})
this.setData({optionList})
},
confirm() {
let { optionList } = this.data
const choiceList = optionList.filter(i => i.active)
if (!choiceList.length){
return wx.showToast({
title: '请选择创建订单的方式',
icon: 'none'
})
}
wx.$router.go(choiceList[0].url,{
activityName: this.data.activityName,
activityId: this.data.activityId
})
this.setData({
show: false
})
},
cancel() {
let thisPage = wx.$router.getPageInstance()
thisPage.setData({
showPickerSelect: false
})
}
}
});
{
"component": true,
"usingComponents": {}
}
<!--packageEquity/components/storePicker/storePicker.wxml-->
<popup show="{{show}}" bindconfirm="confirm" bindcancel="cancel" height="480rpx" title="请选择创建订单方式">
<!-- <view class="sub-title text-center">请选择创建订单方式</view> -->
<block wx:for="{{optionList}}" wx:key="index">
<view class="picker_item {{item.active?'active':''}}" bindtap="changeitem" data-target="{{item}}">
<view class="value">
{{item.name || ''}}
</view>
<view class="checked">
<view class="checked_icon" hidden="{{!item.active}}">
<image src="../../../components/images/choose.png" />
</view>
</view>
</view>
</block>
</popup>
/* packageEquity/components/storePicker/storePicker.wxss */
/*.date-confirm {*/
/* display: flex;*/
/* justify-content: center;*/
/* align-items: center;*/
/* padding:0 20rpx;*/
/* !*font-size:34rpx;*!*/
/* line-height: 70rpx;*/
/*}*/
/*.picker-box{*/
/* font-size: 34rpx;*/
/* text-align: center;*/
/*}*/
/*.picker-box .pickViewColumn{*/
/* padding: 20rpx 0;*/
/* border-bottom: 1px solid red;*/
/*}*/
.sub-title {
height: 100rpx;
font-size: 32rpx;
color: #222222;
position: sticky;
left: 0;
top: 0;
background-color: #fff;
z-index: 2;
border-bottom: 1rpx solid #EDEDED;
}
.text-hide {
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}
.text-center{
display: flex;
align-items: center;
justify-content: center;
}
.picker_select_box{
height: calc(100% - 100rpx);
}
.picker_item{
width: 100%;
height: 104rpx;
display: flex;
align-items: center;
font-size: 32rpx;
border-bottom: 1rpx solid #F7F7F7;
}
.picker_item.active{
color: #3582EE;
}
.checked{
flex-shrink: 0;
width: 32rpx;
height: 32rpx;
margin-right: 24rpx;
}
.checked_icon{
width: 32rpx;
height: 32rpx;
}
.picker_item .value{
flex: 1;
}
// packageEquity/components/storePicker/storePicker.js
Component({
options: {
// 在组件定义时的选项中启用多slot支持
multipleSlots: true
},
/**
* 组件的属性列表
*/
properties: {
items: {
type: Array,
value: [],
observer: function (n) {
let { selectObj, defaultSelectInfo } = this.data
if (n && selectObj.key) {
let defaultSelectIndex = n?.findIndex(v => {return v[selectObj.key] == defaultSelectInfo[selectObj.key]}) > -1 ? n?.findIndex(v => {return v[selectObj.key] == defaultSelectInfo[selectObj.key]}) : 0
this.setData({defaultSelectIndex: [defaultSelectIndex], selectIndex: defaultSelectIndex})
}
}
},
show: {
type: Boolean,
},
defaultSelectInfo: {
type: Object
},
selectObj: {
type: Object
}
},
/**
* 组件的初始数据
*/
data: {
searchValue:'',
selectIndex:'',
edit: false,
defaultSelectIndex: []
},
/**
* 组件的方法列表
*/
methods: {
open() {
if (this.data.disabled) return
this.setData({
edit: true,
inputFocus: true
})
},
setValue(value) {
if (this.properties.filterEmoji) {
if (wx.$util.haveEmoji(value)) value = wx.$util.replaceEmoji(value)
}
this.setData({
searchValue: value
})
},
input(e) {
let {
value
} = e.detail
this.setValue(value)
this.triggerEvent('input', {
value
})
},
inputBlur(e) {
this.emit(e)
},
inputConfifm(e) {
this.emit(e)
},
emit(e) {
let {
detail:{
value
},
type
} = e
this.setData({
edit: false
})
this.setValue(value)
this.triggerEvent(type == 'confirm' ? 'search' : 'blur', {value})
},
confirm() {
let {selectIndex, items } = this.data
if (!items.length) {
return wx.$util.showToast('请选择门店')
}
this.triggerEvent('confirm', selectIndex)
this.setData({
show: false
})
},
changeStore(e) {
this.setData({
selectIndex: e.detail.value[0]
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--packageEquity/components/storePicker/storePicker.wxml-->
<popup class="date-background" show="{{show}}" bindconfirm="confirm" height="800rpx">
<view class='date-container'>
<view class='date-confirm'>
<view class="search-box">
<view class="search-input">
<block wx:if="{{!edit}}">
<view class="input {{searchValue?'':'placeholder'}}" bindtap="open">
<block wx:if="{{searchValue}}">
{{searchValue}}
</block>
<block wx:else>
<image src="../../../images/search.png" class="icon"></image>
请输入{{selectObj.placeholder}}
</block>
</view>
</block>
<block wx:else>
<input type="text" class="input" value='{{searchValue}}' focus='{{inputFocus}}' confirm-type="search" bindinput='input' bindblur="inputBlur" bindconfirm="inputConfifm"/>
</block>
</view>
</view>
</view>
<view class="picker-box">
<picker-view class="picker" value="{{defaultSelectIndex}}" immediate-change="true" indicator-class="indicator" bindchange="changeStore">
<picker-view-column>
<block wx:for="{{items}}" wx:key="item">
<view class="view pickViewColumn">{{item[selectObj.label]}}</view>
</block>
</picker-view-column>
</picker-view>
</view>
</view>
</popup>
/* packageEquity/components/storePicker/storePicker.wxss */
.search-box {
height: 104rpx;
display: flex;
align-items: center;
justify-content: center;
margin: 0 32rpx;
font-size: 28rpx;
}
.search-box .search-input {
width: 686rpx;
height: 72rpx;
background: #F7F8FA;
border-radius: 38rpx;
color: #333;
}
.search-input .input{
display: flex;
align-items: center;
justify-content: center;
height: 100%;
width: 100%;
text-align: center;
}
.search-input .icon{
width: 28rpx;
height: 28rpx;
margin-right: 10rpx;
}
.search-input .placeholder{
color: #C8C9CC;
}
.date-confirm {
display: flex;
justify-content: center;
align-items: center;
padding:0 20rpx;
font-size:34rpx;
line-height: 70rpx;
}
.picker-box{
height: 450rpx;
display: flex;
}
.picker-box .picker{
width: 100%;
}
.tbn_class{
font-size: 26rpx;
color: #333;
}
.pickViewColumn{
text-align: center;
line-height: 34px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
\ No newline at end of file
var replaceItemText = function (item) {
var reg = getRegExp(';~;', 'g')
// return item.replace(reg, ' ')
return item ? item.replace(reg, ' ') : null
}
var isIncludesItem = function (list, item) {
//
// console.log(list.indexOf(item))
// var flag = list.indexOf(item)
return list.indexOf(item) != -1
}
/*
* 导出
*/
module.exports = {
replaceItemText: replaceItemText,
isIncludesItem: isIncludesItem
}
// packageCrowdFunding/pages/activityList/activityList.js
import api from '../../api'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
tabIndex: 0,
navBarHeight: 0,
defaultOderSelect: '',
showPicker: false,
oderSelectItem: [{ merchantName: 1 }, { merchantName: 2 }],
activityId: '',
activityName: '',
activityListRange: [],
selectObj: {
key: 'id',
label: 'activityName',
placeholder: '活动'
},
defaultSelectInfo: {},
selectIndex: 0,
userInfo: {}
},
onRoute(options) {
this.setData({
showActivityDetail: true
})
if (!options.activityId) return
let activityId = options.activityId
let activityName = options.activityName
this.setData({
activityId,
activityName,
userInfo: wx.$util.getUserInfo() || {}
}),
// 获取活动商品
this.getShop(activityId)
// 获取活动列表(切换活动)
this.getActivityList()
},
getActivityList(e) {
let storeInfo = wx.$util.getUserInfo()?.default4SStoreInfo_crowdFunding || {}
let { defaultSelectInfo, activityId, activityName } = this.data
defaultSelectInfo = {
id: activityId,
activityName: activityName
}
let params = {
pageSize: 9999,
pageNum: 1,
activityName: e?.detail.value,
merchantId: storeInfo?.merchantId
}
this.setData({ defaultSelectInfo })
api.queryActivityList(params).then(res => {
if (res.code == '0') {
let { list } = res.data
this.setData({ activityListRange: list })
} else {
this.setData({
activityListRange: []
})
wx.$util.showToast(res.message || '接口异常')
}
})
},
changePicker(e) {
let { activityListRange, selectIndex, defaultSelectInfo } = this.data
let value = (e.detail ?? '') === '' ? selectIndex : e.detail
defaultSelectInfo = activityListRange[value]
this.setData({
defaultSelectInfo,
activityId: defaultSelectInfo.id,
activityName: defaultSelectInfo.activityName
})
this.getShop(defaultSelectInfo.id || '')
// 获取活动订单列表 search
this.selectComponent('#acitivity-detail')?.search && this.selectComponent('#acitivity-detail')?.search()
},
showActivityPicker() {
this.setData({
showActivityPicker: true
})
},
getShop(activityId) {
api.getSamePriceGoodsAPI({ actId: activityId }).then(res => {
let { code, data, message } = res
if (code == 0) {
// 替换商品名称中的分号
const goodsList = data || []
const reg = RegExp(';~;', 'g')
goodsList.map(item => {
item.goodsName = item.goodsName.replace(reg, ' ')
return item
})
app.globalData.crowdFundingShopInfo = goodsList
} else {
wx.$util.showToast(message)
}
})
},
navbarReady(e) {
let navBarHeight = e.detail.height
this.setData({
navBarHeight
})
},
back() {
wx.$router.back()
},
/**
* 生命周期函数--监听页面加载
*/
showMannerPicker() {
this.setData({
showPicker: true
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.setData({
showActivityDetail: true
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
this.setData({
showActivityDetail: false
})
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
})
{
"usingComponents": {
"acitivity-detail": "../../components/activityDetail/activityDetail",
"popup-manner": "../../components/popupManner/popupManner",
"top-select-picker": "../../components/topSelectPicker/topSelectPicker"
},
"navigationStyle": "custom"
}
/* packageCrowdFunding/pages/activityList/activityList.wxss */
\ No newline at end of file
<!--packageCrowdFunding/pages/activityList/activityList.wxml-->
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showBack="{{true}}" bindback="back">
<view class="navigation-title" bindtap="showActivityPicker">
<view class="navigation-title-text text-hide">{{activityName}}</view>
<view class="arrow">
<image src="/images/back.png"/>
</view>
</view>
</navigation-bar>
<view class="layout" style="padding-top:{{navBarHeight}}px;position: relative;">
<block wx:if="{{showActivityDetail}}">
<acitivity-detail id="acitivity-detail" activityId="{{activityId}}" activityName="{{activityName}}"></acitivity-detail>
</block>
</view>
<!-- 超管isSuper/商户号类型 userType 2(员工号)账号不可操作 -->
<image data-target="addOrder" wx:if="{{!userInfo.isSuper && userInfo.userType == 2}}" bind:tap="showMannerPicker" class="addOrder" src="./../../images/addOrder.png" mode="scaleToFill|aspectFit|aspectFill|widthFix" binderror="" bindload="" />
<popup-manner show="{{showPicker}}" activityName="{{activityName}}" activityId="{{activityId}}" bindconfirm="changePicker"></popup-manner>
<top-select-picker show="{{showActivityPicker}}" selectObj="{{selectObj}}" defaultSelectInfo="{{defaultSelectInfo}}" items="{{activityListRange}}" bindsearch="getActivityList" bindconfirm="changePicker"></top-select-picker>
.layout{
height: 100vh;
box-sizing: border-box;
}
.navigation-title{
display: flex;
align-items: center;
justify-content: center;
}
.navigation-title .arrow {
flex-shrink: 0;
width: 32rpx;
height: 32rpx;
margin-left: 4rpx;
transform: rotate(180deg);
transition: all 0.5s;
}
.headerBar {
box-sizing: border-box;
position: relative;
width: 100%;
height: 280rpx;
padding: 24rpx 32rpx 32rpx;
background-image: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/equity/equityBg.png');
background-size: 100% 100%;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.headerBar .totalCount {
/* position: absolute;
left: 50%;
transform: translateX(-50%); */
width: 686rpx;
height: 212rpx;
display: flex;
align-items: center;
box-sizing: border-box;
padding: 32rpx 40rpx;
background-image: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/equity/headerBg.png');
background-size: 100% 100%;
font-size: 24rpx;
color: #FFFFFF;
}
.headerBar .totalCount .item {
display: flex;
}
.headerBar .totalCount .left {
width: 260rpx;
}
.headerBar .totalCount .num {
display: flex;
align-items: baseline;
line-height: 22rpx;
}
.headerBar .totalCount .item {
margin: 25rpx 0 25rpx;
}
.headerBar .totalCount .company {
font-size: 48rpx;
font-weight: 600;
}
.headerBar .totalCount .decimal {
font-weight: 600;
}
.headerBar .totalCount .line {
width: 2rpx;
height: 116rpx;
background: #ffffff59
}
.headerBar .totalCount .countNum {
font-size: 34rpx;
font-weight: 500;
margin-left: 15rpx;
}
.headerBar .totalCount .labelStr {
margin-right: 5rpx;
}
.headerBar .totalCount .right {
margin-left: 40rpx;
}
.picker-box{
height: 450rpx;
display: flex;
}
.picker-box .picker{
width: 100%;
}
.addOrder {
width: 112rpx;
height: 112rpx;
position: fixed;
right: 32rpx;
bottom: 200rpx;
}
// packageCrowdFunding/pages/activityPay/activityPay.js
// import { centsToyuan } from "~/utils/format";
import constantData from './constant/data'
import { getOrderDetail, createPayOrder, createPayOrderAPI, getSamePriceGoodsAPI } from '../../api'
import { createQrcodeImage } from '~/api/api'
import qrcode from '~/utils/lib/wxqrcode'
let time = null
Page({
/**
* 页面的初始数据
*/
data: {
orderObj: constantData.orderObj,
orderInfo: {},
goodsList: {},
showStatus: false,
wxqrcode: '',
posqrcode: '',
orderPaySource: 3, //1微信 3pos
supplementOrderFlag: '',
payItems: [
{ id: 1, name: '微信支付', icon: 'pay-wechat' },
{ id: 3, name: 'POS机', icon: 'pay-pos' }
],
timer: null,
orderList: [
{
name: '客户姓名',
value: 'customerName'
},
// {
// name: '推荐人',
// value: 'transfer'
// },
{
name: '活动名称',
value: 'activityName'
},
{
name: '商品名称',
isMark: true,
value: 'goodsName'
},
{
name: '订金金额',
value: 'depositPrice',
handle: 'money'
},
{
name: '订金支付时间',
value: 'payDate'
},
{
name: '订单编号',
value: 'subOrderCode'
}
],
paramsActivityPrice: ''
},
// 生成小程序码
createWxQrcode() {
let { wxqrcode } = this.data
if (wxqrcode) return
let _this = this
let oParams = {}
oParams.appId = 'wx06d1198e751435d1'
oParams.qrcodeType = 'QR_WXA_UNLIMIT'
oParams.path = 'packagesPayment/pages/payment/index'
oParams.scene = `orderCode=${_this.data.orderCode}&workWxSessionId=${wx.getStorageSync('dj_boutique_sessionId')}`
oParams.channelType = 1
// B端小程序调用接口生成领券码时,传参userId用uuid,类型由int变string
createQrcodeImage(oParams).then(res => {
console.log(res.data)
console.log(res.code)
_this.setData({
wxqrcode: res.data
})
})
},
async posPay(outTradeNo) {
let { posqrcode } = this.data
// 没有生成过二维码
if (!posqrcode) {
// console.log(text)
let size = 0
try {
const info = wx.getSystemInfoSync()
let scale = info.windowWidth / 750 //不同屏幕下QRcode的适配比例;设计稿是750宽
let width = 300 * scale
size = width
} catch (e) {
size = 150
}
let _img = qrcode.createQrCodeImg(outTradeNo, {
size: parseInt(size)
})
this.setData({
posqrcode: _img
})
}
},
// 多商品切换商品 重新生成支付订单
changeGoods(e) {
if (time) clearInterval(time)
let { orderCode } = this.data
let value = e?.detail || {}
let {accountName} = wx.$util.getUserInfo()
let params = {
subOrderCode: orderCode,
orderPaySource: 1,
shopmallGoodsId: value.specialGoodsId,
selectPayType:1,
updatedBy: accountName
}
wx.$util.showLoading()
createPayOrderAPI(params).then(res => {
let {code, data, message} = res
wx.$util.hideLoading()
if (code == '0') {
this.getDetail()
} else {
wx.$util.showToast(message || '接口异常')
}
})
},
initOrderInfo() {
const { orderObj, orderList, paramsActivityPrice, paramsActivityId } = this.data
// 商品
getSamePriceGoodsAPI({actId: paramsActivityId, activityPrice: paramsActivityPrice}).then(res => {
let { code, data, message } = res
if (code == 0) {
if (data && orderObj?.shopFormList) {
if (data?.length > 1) {
// 多商品
orderList[2].isMark = true
const reg = RegExp(';~;', 'g')
orderObj.shopFormList[0].optionList = data.map(item => {
item.goodsName = item.goodsName.replace(reg, ' ')
item.shopmallGoodsId = item.businessSpecificationId
return item
})
} else {
// 单商品直接带出商品名称
orderList[2].isMark = false
}
}
} else {
wx.$util.showToast(message)
}
this.setData({ orderObj, orderList })
})
this.setData({ orderObj, orderList })
},
getDetail() {
let { orderCode, orderInfo } = this.data
// console.log(orderCode)
let _this = this
getOrderDetail({
orderCode
})
.then(res => {
// console.log(res)
let { code, message, data } = res
if (code != 0) return
// data.orderTime = wx.$util.tsFormatTime(data.orderTime, 'Y-M-D h:m:s')
data.orderTime = data.orderTime ? wx.$util.tsFormatTime(data.orderTime, 'Y年M月D日 h:m:s') : ''
// data.paySuccessDate = data.paySuccessDate ? wx.$util.tsFormatTime(data.paySuccessDate, 'Y-M-D h:m:s') : ''
if (code == 0) {
let copyData = {
...data.customer,
...data,
...data.shopmallSubOrder.shopmallOrder,
...data.shopmallSubOrder,
...data.payOrder
}
let payDate = copyData?.payDate
copyData.payDate = payDate ? wx.$util.tsFormatTime(payDate, 'Y年M月D日 h:m:s') : ''
orderInfo.shopmallGoodsId = copyData.goodsId || ''
this.setData({
orderDetail: copyData,
orderInfo
})
wx.$util.hideLoading()
// console.log(data.payOrder?.payStatus, 'payorder.paystatus')
let { payOrder, status } = data
if (payOrder?.payStatus == 2 || status == 4) {
wx.$util.showToast('支付成功')
if (time) clearInterval(time)
// 通知并跳转成功页面
// _this.changeOrderStatus()
wx.$router.redirectTo('paymentSuccess', { orderCode })
}
} else {
wx.showModal({
title: '温馨提示',
content: message,
showCancel: false,
confirmText: '刷新',
confirmColor: '#3582EE',
success(res) {
if (res.confirm) {
_this.getDetail(orderCode)
}
}
})
}
})
.finally(() => {
if (time) clearInterval(time)
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1]
const url = `${currentPage.route}`
if ('packageCrowdFunding/pages/activityPay/activityPay' == url) {
time = setInterval(() => {
_this.getDetail(orderCode)
}, 5 * 1000)
}
})
},
async handleTab(e) {
console.log(e.target.dataset)
const { id: orderPaySource } = e.target.dataset.item
let { orderCode } = this.data
this.setData({
orderPaySource
})
if (orderPaySource == 3) {
let result = await createPayOrder({
orderCode,
payType: orderPaySource
})
let { code, data } = result
if (code != 0) return
this.posPay(data.outTradeNo)
}
// orderPaySource == 3 ? this.posPay(data.outTradeNo) : this.createWxQrcode()
},
back() {
wx.$router.back()
},
showPopup(e) {
this.setData({
showPickerSelect: true,
pickerObj: this.data.orderObj.shopFormList[0]
})
},
onRoute(options) {
console.log(options)
// 先模拟数据
// options = {
// orderCode: 'S2304101345174444',
// orderPaySource: 1
// }
// selectPayType
let { orderCode, selectPayType: orderPaySource = 1, outTradeNo, paramsActivityPrice, paramsActivityId, supplementOrderFlag } = options
this.setData({
orderCode,
orderPaySource,
paramsActivityPrice,
paramsActivityId,
supplementOrderFlag
})
this.initOrderInfo()
// 获取支付订单详情
this.getDetail()
orderPaySource == 3 ? this.posPay(outTradeNo) : this.createWxQrcode()
// let { orderCode, selectPayType } = options
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// const timer = setInterval(this.getQrCode, 3000)
// this.setData({
// timer
// })
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
const { timer } = this.data
console.log(timer)
clearInterval(timer)
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
if (time) clearInterval(time)
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
})
{
"usingComponents": {
"select-goods": "components/SelectGoods/index",
"activity-info": "../../components/activityInfoCom/activityInfoCom",
"picker-select": "/packageCrowdFunding/components/PickerSelect/PickerSelect"
},
"navigationStyle": "custom"
}
page {
height: 100vh;
background-color: #f3f5f7
}
.big-img {
box-sizing: border-box;
position: relative;
width: 100%;
height: 320rpx;
padding: 24rpx 36rpx 32rpx;
background-image: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/equity/headerBg-l.png');
background-size: 100% 100%;
//z-index: -1;
.titleBox {
display: flex;
padding-top: 80rpx;
align-items: center;
width: 55%;
justify-content: space-between;
color: #fff;
.imgBox image {
width: 18rpx;
height: 34rpx;
display: inline-block;
vertical-align: middle;
}
}
.money {
color: #fff;
font-size: 28rpx;
display: flex;
margin-top: 40rpx;
.sum {
font-size: 34rpx
}
}
}
.box {
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: center;
width: 710rpx;
height: 716rpx;
background: #FFFFFF;
border-radius: 16rpx;
margin: -34rpx auto 34rpx;
// z-index: 100;
.right image {
width: 14rpx;
height: 24rpx;
display: inline-block;
vertical-align: middle;
}
.tab-head {
display: flex;
width: 100%;
height: 100rpx;
overflow: hidden;
border-radius: 16rpx 16rpx 0 0;
overflow: hidden;
.tab-item {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
font-weight: 600;
font-size: 32rpx;
color: #222222;
background-color: #ebf2fd;
z-index: 2;
&.active {
background: #fff;
}
}
}
.tab-title {
margin: 36rpx 0;
}
.tab-qrcode {
width: 430rpx;
height: 430rpx;
}
.tab-desc {
margin-top: 20rpx;
font-size: 24rpx;
color: #666666;
}
}
.infoBox {
// margin-top: 60rpx;
margin-top: 20rpx;
display: flex;
justify-content: center;
}
.cofirm {
width: 80%;
height: 80rpx;
background: #3582EE;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
margin: 300rpx auto;
border-radius: 12rpx;
}
.btn_icon {
width: 40rpx;
height: 40rpx;
margin-right: 10rpx;
}
.order-box {
width: 702rpx;
background: #FFFFFF;
box-shadow: 0 10rpx 20rpx 0 #8192d63d, inset 0 -2rpx 6rpx 0 #ffffff66;
border-radius: 16rpx;
padding: 32rpx 40rpx;
box-sizing: border-box;
margin: 100rpx auto;
.order-title {
font-weight: 600;
font-size: 32rpx;
color: #1B233D;
//line-height: 48rpx;
}
.order-item {
font-size: 26rpx;
color: #7A8299;
//line-height: 40rpx;
margin-top: 16rpx;
display: flex;
align-item: center;
view {
&:first-child {
width: 200rpx;
display: inline-block;
}
&:last-child {
color: #1B233D;
}
&.mark-text {
color: #4466F0;
display: flex;
height: 40rpx;
width: calc(100% - 200rpx);
.goods_name_class{
max-width: calc(100% - 30rpx);
margin-right: 10rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
}
}
.money{
display: inline-block
}
<!-- packageCrowdFunding/pages/balanceNote/balanceNote.wxml -->
<wxs src="../balanceNote/index.wxs" module="filter" />
<wxs src="../../index.wxs" module="filter2" />
<view class="big-img page-box isFullSucreen">
<view class="titleBox">
<view class="imgBox" bind:tap="back">
<image src="../../images/arrow-left.png" />
</view>
<view class="navigation-title-text">去支付</view>
</view>
<view class="money">
{{supplementOrderFlag == 1 ? '付款金额' : '尾款金额'}}
<view class="sum">¥{{orderDetail.totalPrice || 0}}</view>
</view>
</view>
<view class=" box">
<view class="tab-head">
<view
class="tab-item {{orderPaySource === item.id?'active':'' }}"
wx:for="{{payItems}}"
wx:key="index"
data-item="{{item}}"
catchtap="handleTab">
<gl-image
class="btn_icon"
data-item="{{item}}"
webp
src="/miniProgram/wxPay.png"
wx:if="{{item.id==1}}" />
<gl-image
class="btn_icon"
data-item="{{item}}"
webp
src="/miniProgram/posPay.png"
wx:else></gl-image>
{{item.name}}
</view>
</view>
<view class="tab-title">{{orderDetail.merchantName}}</view>
<view class="tab-qrcode">
<image src="{{orderPaySource==1?wxqrcode:posqrcode}}" mode="widthFix" />
</view>
<view class="tab-desc" hidden="{{orderPaySource==3}}">请让客户打开微信扫描上方付款码进行支付</view>
<view class="tab-desc" hidden="{{orderPaySource==1}}">请使用POS机扫描此码,再向客户收款</view>
</view>
<!-- <view class="infoBox"> -->
<!-- <activity-info orderInfo="{{orderDetail}}" /> -->
<!-- </view> -->
<view class="order-box">
<view class="order-title">订单信息</view>
<view class="order-item" wx:for="{{orderList}}" wx:key="index">
<view>{{item.name}}</view>
<view wx:if="{{item.isMark}}" class="mark-text" bindtap="showPopup">
<text class="goods_name_class">{{filter2.replaceItemText(orderDetail[item.value]) || '请选择商品'}}</text>
<text>></text>
</view>
<view class="money" wx:elif="{{item.handle == 'money'}}">
¥{{orderDetail[item.value] || 0}}
</view>
<view wx:else>{{orderDetail[item.value] || ''}}</view>
</view>
</view>
<picker-select
show="{{showPickerSelect}}"
title="请选择商品"
pickerObj="{{pickerObj}}"
orderInfo="{{orderInfo}}"
bindconfirm="changeGoods" />
<!-- <view class="page-box isFullSucreen">
<view class="img-bg">
<glsx-image webp src="store-assistant/visitor_bg.png" />
</view>
<view class="container-box">
<view class="pay-price">
尾款金额
<text class="unit">¥</text>
<text class="price-before">1598</text>
<text class="price-after">.98</text>
</view>
<view class="tab-box">
<view class="tab-head">
<view
class="tab-item {{payStyle === item.id?'active':'' }}"
wx:for="{{payItems}}"
wx:key="index"
data-item="{{item}}"
catchtap="handleTab">
<glsx-image
class="btn_icon"
data-item="{{item}}"
webp
src="store-assistant/pay-wechat.png"
wx:if="{{item.id==1}}" />
<glsx-image
class="btn_icon"
data-item="{{item}}"
webp
src="store-assistant/pay-pos.png"
wx:else></glsx-image>
{{item.name}}
</view>
</view>
<view class="tab-title">广联嘀加园区店</view>
<view class="tab-qrcode">
<image src="https://t12.baidu.com/it/u=1689026450,3552214048&fm=58" mode="widthFix" />
</view>
<view class="tab-desc">请让客户打开微信扫描上方付款码进行支付</view>
</view>
<view class="order-box">
<view class="order-title">订单信息</view>
<view class="order-item" wx:for="{{orderList}}" wx:key="index">
<text>{{item.name}}</text>
<text wx:if="{{item.isMark}}" class="mark-text" bindtap="showPopup">
{{item.name}} >
</text>
<text wx:else>{{item.name}}</text>
</view>
</view>
</view>
</view> -->
// packageStoreAssistant/components/SelectGoods/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
show: Boolean,
// goodsId: {
// type: Number,
// observer: function (val) {
// if (val) {
// this.getGoodscouponList(val);
// }
// },
// },
},
/**
* 页面的初始数据
*/
data: {
columns: [{type:1,name:'111'},{type:2,name:'222'}],
selectValue: '',
},
methods: {
onChange(event) {
const {picker, value, index} = event.detail;
this.setData({
selectValue: value
})
},
comfirm() {
const {selectValue} = this.data
this.triggerEvent('setGoods', selectValue)
this.cancel()
},
cancel() {
this.setData({
show: false
})
},
}
})
{
"usingComponents": {
"van-popup": "@vant/weapp/popup/index",
"van-picker": "@vant/weapp/picker/index"
}
}
/* packageStoreAssistant/components/SelectGoods/index.wxss */
.container{
width: 100%;
height: 100%;
border-radius: 20rpx;
overflow: hidden;
.header{
height: 102rpx;
width: 100%;
box-sizing: border-box;
padding: 0 64rpx;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 2rpx solid #efefef;
border-radius: 20rpx;
.text{
font-weight: 400;
font-size: 32rpx;
color: #999999;
}
.goods {
color: #1B233D;
}
.comfirm{
font-weight: 500;
color: #FC5B32;
}
.title{
font-weight: 400;
color: #333333;
}
}
.pannel{
width: 100%;
height: calc(100% - 102rpx);
box-sizing: border-box;
padding: 32rpx 40rpx;
}
}
\ No newline at end of file
<!--packageStoreAssistant/components/SelectGoods/index.wxml-->
<van-popup show="{{ show }}" round bind:click-overlay="cancel" custom-class="popclass" position="bottom" custom-style="height: 45%">
<view class="container">
<view class="header">
<view class="text" catch:tap="cancel">取消</view>
<view class="text goods">选择商品</view>
<view class="text comfirm" catch:tap="comfirm">确定</view>
</view>
<view class="pannel">
<van-picker columns="{{ columns }}" bind:change="onChange" />
</view>
</view>
</van-popup>
const orderObj = {
shopFormList: [
{
label: '商品名称',
pickerTitle: '商品',
name: 'goodsName',
type: 'select',
optionList: [],
optionId: 'shopmallGoodsId',
optionName: 'goodsName',
flag: true
}
]
}
export default {
orderObj,
}
// packageCrowdFunding/pages/additionRecordOrder/additionRecordOrder.js
import constantData from './constant/data'
import api from '../../api'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
orderObj: constantData.orderObj,
orderInfo: {},
orderNoPopup: false,
activityName: '',
activityId: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// 推荐人
let { orderObj, orderInfo } = this.data
if (app.globalData?.staffListRange && orderObj?.orderFormList) {
orderObj.orderFormList[orderObj.orderFormList.length - 1].optionList = app.globalData.staffListRange
}
// 商品
if (app.globalData?.crowdFundingShopInfo && orderObj?.shopFormList) {
if (app.globalData?.crowdFundingShopInfo?.length > 1) {
// 多商品
orderObj.shopFormList[0].optionList = app.globalData?.crowdFundingShopInfo
} else {
// 单商品直接带出商品名称
orderObj.shopFormList[0].type = 'input'
orderObj.shopFormList[0].readonly = true
orderInfo.shopmallGoodsId = app.globalData?.crowdFundingShopInfo[0]?.goodsId || ''
orderInfo.goodsName = app.globalData?.crowdFundingShopInfo[0]?.goodsName || ''
orderInfo.activityPrice = `¥${this.priceFilter(app.globalData?.crowdFundingShopInfo[0]?.activityPrice / 100 || 0)}`
orderInfo.crowdFundingPrice = `¥${this.priceFilter(app.globalData?.crowdFundingShopInfo[0]?.crowdFundingPrice / 100 || 0)}`
orderInfo.tailPayment = `¥${this.priceFilter((app.globalData?.crowdFundingShopInfo[0]?.crowdFundingPrice - app.globalData?.crowdFundingShopInfo[0]?.activityPrice) / 100 || 0)}`
orderInfo['totalFee'] = app.globalData?.crowdFundingShopInfo[0]?.crowdFundingPrice || 0
orderInfo.goodsId = app.globalData?.crowdFundingShopInfo[0]?.goodsId
}
}
this.setData({ orderObj, orderInfo })
},
priceFilter(num) {
var pow = Math.pow(10, 2)
return (Math.round(num * pow) / pow).toFixed(2)
},
onRoute(options) {
let { activityId, activityName } = options
this.setData({
activityId,
activityName
})
},
// 交易流水号
showOrderNoPopup() {
let { orderInfo } = this.data
if (!orderInfo.goodsId) {
return wx.$util.showToast('请先选择商品')
}
this.setData({
orderNoPopup: true
})
},
// 自定义picker选择器
showPickerSelect(e) {
this.setData({
showPickerSelect: true,
pickerTitle: e?.detail?.label,
pickerObj: e?.detail || {}
})
},
confirm() {
let { orderInfo, activityName, activityId } = this.data
let userInfo = wx.$util.getUserInfo()
let validObj = wx.$util.checkRule(orderInfo, constantData.formRule)
if (validObj) {
wx.$util.showToast(validObj.message)
return
}
wx.showModal({
title: '补录订单确认',
content: '确定补录此订单',
confirmText: '确定',
confirmColor: '#3582EE',
success(res) {
if (res.confirm) {
let params = {
outTradeNo: orderInfo.outTradeNo,
customerName: orderInfo.customerName,
customerPhone: orderInfo.customerPhone,
userId: orderInfo.uuid,
employeeName: orderInfo.staffName,
merchantId: userInfo?.default4SStoreInfo_crowdFunding?.merchantId,
merchantName: userInfo?.default4SStoreInfo_crowdFunding?.merchantName,
shopmallGoodsId: orderInfo.goodsId,
orderPaySource: 4,
activityId: activityId,
activityName: activityName
}
wx.$util.showLoading()
api.createFullPayOrderAPI(params).then(res => {
wx.$util.hideLoading()
let { code } = res
if (code == '0') {
wx.$router.back()
}
})
}
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
})
{
"navigationBarTitleText": "订单补录",
"usingComponents": {
"gl-form": "/packageCrowdFunding/components/GLForm/GLForm",
"order-no-popup": "/packageCrowdFunding/components/OrderNoPopup/OrderNoPopup",
"picker-select": "/packageCrowdFunding/components/PickerSelect/PickerSelect"
}
}
\ No newline at end of file
/* packageCrowdFunding/pages/additionRecordOrder/additionRecordOrder.wxss */
\ No newline at end of file
<!--packageCrowdFunding/pages/additionRecordOrder/additionRecordOrder.wxml-->
<view class="addition-record-order">
<view class="title">订单信息</view>
<view class="content-box">
<view class="box">
<gl-form formData="{{orderInfo}}" bindshowPickerSelect="showPickerSelect" formDataList="{{orderObj.shopFormList}}"></gl-form>
</view>
<view class="box">
<gl-form bindshowOrderNoPopup="showOrderNoPopup" bindshowPickerSelect="showPickerSelect" formData="{{orderInfo}}" dataAttrName="orderInfo" formDataList="{{orderObj.orderFormList}}"></gl-form>
</view>
</view>
<view class="btn-box {{isFullSucreen?'isFullSucreen-btn':''}}">
<view class="btn" bindtap="confirm">确定</view>
</view>
</view>
<order-no-popup
wx:if="{{orderNoPopup}}"
show="{{orderNoPopup}}"
title="请选择交易参考号"
orderInfo="{{orderInfo}}"/>
<picker-select
show="{{showPickerSelect}}"
title="请选择{{pickerTitle}}"
pickerObj="{{pickerObj}}"
orderInfo="{{orderInfo}}"
isAdditionRecordOrder="true"
/>
/* packageCrowdFunding/pages/additionRecordOrder/additionRecordOrder.wxss */
.addition-record-order{
width: 100%;
box-sizing: border-box;
padding: 40rpx 20rpx;
background-color: #F4F5F7;
height: 100vh;
}
.title{
margin: 0 0 20rpx 32rpx;
font-weight: 500;
font-size: 32rpx;
color: #222222;
}
.box{
background: #FFFFFF;
box-shadow: 0 4rpx 16rpx 0 #cdcdd180;
border-radius: 16rpx;
padding: 16rpx;
margin-bottom: 20rpx;
}
.btn-box{
position: fixed;
left: 0;
width: 100%;
bottom: 0;
min-height: 100rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
}
.btn{
width: 622rpx;
height: 88rpx;
color: #fff;
border-radius: 12rpx;
background-color: #3582EE;
display: flex;
align-items: center;
justify-content: center;
}
.isFullSucreen-btn{
padding-bottom: 34px !important;
}
const phoneRex = /^[1]([3-9])[0-9]{9}$/
const formRule = {
goodsId: [ { required: true, message: '请选择商品' } ],
outTradeNo: [{ required: true, message: '交易流水号不能为空' }],
customerName: [{ required: true, message: '客户名称不能为空' }],
customerPhone: [
{ required: true, message: '联系电话不能为空' },
{
validator: (rule, value) => {
return !phoneRex.test(value) ? { message: '请输入正确的手机号' } : null
}
}
],
uuid: [{ required: true, message: '推荐人不能为空' }],
}
const orderObj = {
shopFormList: [
{
label: '商品名称',
name: 'goodsName',
type: 'select',
optionList: [],
optionId: 'goodsId',
optionName: 'goodsName',
flag: true
},
{
label: '订金金额',
name: 'depositPrice',
type: 'input',
readonly: true,
placeholder: ' '
},
{
label: '尾款金额',
name: 'tailPayment',
type: 'input',
readonly: true,
noBorder: true,
placeholder: ' '
}
],
orderFormList: [
{
label: '交易流水号',
name: 'outTradeNo',
type: 'outTradeNo',
haveArrow: true,
noCellHeight: true,
placeholder: '请选择'
},
{
label: '客户名称',
name: 'customerName',
type: 'input'
},
{
label: '客户手机号',
name: 'customerPhone',
type: 'input',
fieldType: 'number',
maxlength: 11
},
{
label: '推荐人',
name: 'uuid',
type: 'select',
optionList: [],
optionId: 'uuid',
optionName: 'staffName',
noBorder: true
}
]
}
export default {
orderObj,
formRule
}
// packageCrowdFunding/pages/balanceNote/balanceNote.js
// import constantData from "../additionRecordOrder/constant/data";
import constantData from './constant/data'
const app = getApp()
import api from '../../api'
Page({
/**
* 页面的初始数据
*/
data: {
orderObj: constantData.orderObj,
showStatus: false,
orderNoPopup: false,
orderNoList: [],
// orderListInfo: {},
orderNoInfo: {},
orderInfo: {},
orderList: [
{
name: '客户姓名',
value: 'customerName'
},
{
name: '活动名称',
value: 'activityName'
},
{
name: '商品名称',
isMark: true,
value: 'goodsName'
},
{
name: '订单金额',
value: 'depositPrice'
},
{
name: '定金支付时间',
value: 'payedDateStr'
},
{
name: '订单编号',
value: 'subOrderCode'
}
]
},
handleTransaction() {
this.setData({
orderNoPopup: true
})
},
priceFilter(num) {
var pow = Math.pow(10, 2)
return (Math.round(num / 100 * pow) / pow).toFixed(2)
},
initOrderInfo() {
const {orderObj, orderList, orderInfo} = this.data
// 商品
api.getSamePriceGoodsAPI({actId: orderInfo.activityId, activityPrice: orderInfo.payedDate ? orderInfo.activityPrice : ''}).then(res => {
let { code, data, message } = res
if (code == 0) {
if (data && orderObj?.shopFormList) {
if (data?.length > 1) {
// 多商品
orderList[2].isMark = true
const reg = RegExp(';~;', 'g')
orderObj.shopFormList[0].optionList = data.map(item => {
item.goodsName = item.goodsName.replace(reg, ' ')
item.shopmallGoodsId = item.goodsId
return item
})
} else {
// 单商品直接带出商品名称
orderList[2].isMark = false
}
}
} else {
wx.$util.showToast(message)
}
this.setData({ orderObj, orderList })
})
this.setData({ orderObj, orderList })
},
showPopup(e) {
this.setData({
showPickerSelect: true,
// orderInfo: this.data.orderListInfo,
pickerObj: this.data.orderObj.shopFormList[0]
})
},
confirm() {
const {orderInfo} = this.data
// console.log(orderInfo, orderListInfo)
if (!orderInfo || !orderInfo.outTradeNo) {
return wx.$util.showToast('请选择交易流水号')
}
let {accountName} = wx.$util.getUserInfo()
const {shopmallGoodsId, subOrderCode, outTradeNo} = orderInfo
let params = {
outTradeNo,
subOrderCode,
orderPaySource: 2,
shopmallGoodsId,
selectPayType: 1,
updatedBy: accountName
}
api.createPayOrderAPI(params).then(res => {
let {code, data, message} = res
if (code == '0') {
// wx.$router.reLaunch
wx.$router.redirectTo('paymentSuccess', {orderCode:subOrderCode})
} else {
wx.$util.showToast(message || '接口异常')
}
})
// let { default4SStoreInfo_crowdFunding: merchantInfo } = wx.$util.getUserInfo()
// const { customerName, customerPhone, activityName, activityId, referrer, goodsName, shareStaffUuid: userId, shopmallGoodsId } = orderInfo
// let params = {
// outTradeNo: orderInfo.outTradeNo,
// customerName,
// customerPhone,
// activityName,
// activityId: activityId || '10228',
// goodsName,
// orderPaySource: 2,
// employeeName: referrer,
// userId,
// shopmallGoodsId,
// merchantId: merchantInfo.merchantId,
// merchantName: merchantInfo.merchantName
// }
//
// api.createFullPayOrderAPI(params).then(res => {
// let { code, data, message } = res
// if (code == '0') {
// // wx.$router.reLaunch
//
// wx.$router.redirectTo('activityPay', { orderCode: data.subOrderCode, outTradeNo })
// } else {
// wx.$util.showToast(message || '接口异常')
// }
// })
},
back() {
wx.$router.back()
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
onRoute(options) {
const {list} = options
list.depositPrice = `¥${this.priceFilter(list.activityPrice || 0)}`
list.totalFee = (list.payedDate ? list.tailPayment : list.crowdFundingPrice) || ''
// 补录单 尾款金额显示全款价
list.tailPayment = list.supplementOrderFlag == 1 ? `¥${this.priceFilter(list.crowdFundingPrice || 0)}` : `¥${this.priceFilter(list.tailPayment || 0)}`
list.shopmallGoodsId = list.goodsId || ''
list.payedDateStr = list.payedDate ? wx.$util.tsFormatTime(list.payedDate, 'Y年M月D日 h:m:s') : ''
this.setData({
orderInfo: list
})
this.initOrderInfo()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!