Browse Source

before test

dev
赵明涛 11 months ago
parent
commit
79ced22480
  1. 2
      uniapp_project_code/readme.md
  2. 8
      uniapp_project_code/src/App.vue
  3. 31
      uniapp_project_code/src/components/index/page_standby.vue
  4. 7
      uniapp_project_code/src/components/index/view_footer.nvue
  5. 32
      uniapp_project_code/src/components/index/view_header.nvue
  6. 18
      uniapp_project_code/src/components/login/form.vue
  7. 2
      uniapp_project_code/src/components/login/logo.vue
  8. 58
      uniapp_project_code/src/components/login/pads_picker.vue
  9. 33
      uniapp_project_code/src/components/login/setting_mask.vue
  10. 4
      uniapp_project_code/src/components/pay/paying.vue
  11. 7
      uniapp_project_code/src/pages.json
  12. 4
      uniapp_project_code/src/pages/index/-index.nvue
  13. 15
      uniapp_project_code/src/pages/index/index.vue
  14. 2
      uniapp_project_code/src/pages/index/standby.nvue
  15. 104
      uniapp_project_code/src/pages/login/index.vue
  16. 65
      uniapp_project_code/src/pages/login/success.vue
  17. 9
      uniapp_project_code/src/pages/pay/index.vue
  18. BIN
      uniapp_project_code/src/static/logo@2x.png
  19. 4
      uniapp_project_code/src/utils/server.js
  20. 2
      uniapp_project_code/src/utils/util.js

2
uniapp_project_code/readme.md

@ -10,4 +10,6 @@
6. 不能在 style 中引入字体文件 6. 不能在 style 中引入字体文件
7. 不支持在 nvue 页面使用 typescript/ts。 7. 不支持在 nvue 页面使用 typescript/ts。
### vue注意事项
1. vue版本3.2, 不支持defineModel
参考: https://uniapp.dcloud.net.cn/tutorial/page.html#nvue-%E5%BC%80%E5%8F%91%E4%B8%8E-vue-%E5%BC%80%E5%8F%91%E7%9A%84%E5%B8%B8%E8%A7%81%E5%8C%BA%E5%88%AB 参考: https://uniapp.dcloud.net.cn/tutorial/page.html#nvue-%E5%BC%80%E5%8F%91%E4%B8%8E-vue-%E5%BC%80%E5%8F%91%E7%9A%84%E5%B8%B8%E8%A7%81%E5%8C%BA%E5%88%AB

8
uniapp_project_code/src/App.vue

@ -14,6 +14,7 @@
export default { export default {
onLaunch() { onLaunch() {
console.log("App Launch default"); console.log("App Launch default");
this.globalData.autoLogin = true;
}, },
onShow() { onShow() {
console.log("App Show default"); console.log("App Show default");
@ -22,6 +23,7 @@ export default {
console.log("App Hide default"); console.log("App Hide default");
}, },
globalData: { globalData: {
autoLogin: false,
goodsList : [], goodsList : [],
shopList : [], shopList : [],
accountInfo : { accountInfo : {
@ -31,6 +33,12 @@ export default {
password: "123456", password: "123456",
assistant_client:"PC", assistant_client:"PC",
token: "e6cabeae-0c1a-11ee-aa40-5254005df464", token: "e6cabeae-0c1a-11ee-aa40-5254005df464",
role:""
},
stadiumInfo:{
id: "", //stadium_id
brand_id: "",
venue_name:"",
}, },
loginInfo : { loginInfo : {
phone: "", phone: "",

31
uniapp_project_code/src/components/index/page_standby.vue

@ -1,7 +1,7 @@
<template> <template>
<view class="content"> <view class="content">
<view class="content_title"> <view class="content_title">
<text class="txt">欧轩智能场馆丛云店</text>
<text class="txt" @click="secretClickBackToSetting">欧轩智能场馆丛云店</text>
</view> </view>
<view class="content_info"> <view class="content_info">
<text class="txt">欢迎使用自助收银</text> <text class="txt">欢迎使用自助收银</text>
@ -9,7 +9,7 @@
<image class="content_tip" src="/static/index_tips.png" mode="scaleToFill" /> <image class="content_tip" src="/static/index_tips.png" mode="scaleToFill" />
<image class="content_img" src="/static/index_person.png" mode="scaleToFill" /> <image class="content_img" src="/static/index_person.png" mode="scaleToFill" />
<!-- <main-click-btn > --> <!-- <main-click-btn > -->
<view class="content_btn" @click="clickToUse">
<view class="content_btn" @click="toIndex">
<image class="icon_saoma" src="/static/images/saoma.png" mode="scaleToFill" /> <image class="icon_saoma" src="/static/images/saoma.png" mode="scaleToFill" />
<text class="txt">请扫描商品条形码</text> <text class="txt">请扫描商品条形码</text>
</view> </view>
@ -24,9 +24,36 @@
import mainClickBtn from '@/components/index/button_green_square.vue'; import mainClickBtn from '@/components/index/button_green_square.vue';
import util from "@/utils/util.js" import util from "@/utils/util.js"
import {
onMounted,
ref
} from 'vue'
const countClick = ref(0)
function clickToUse() { function clickToUse() {
util.routeTo(`/pages/login/success`, 'nT'); util.routeTo(`/pages/login/success`, 'nT');
} }
const toIndex = ()=>{
util.routeTo(`/pages/index/index`, 'nT');
}
function secretClickBackToSetting() {
//2.510
countClick.value++
console.log("tabChnage: ",countClick.value)
if(countClick.value >= 10){
countClick.value = 0
util.routeTo(`/pages/login/success`, 'nT');
}
secretClick()
}
const secretClick = util.debounce(function(){
countClick.value = 0
},2500,false)
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

7
uniapp_project_code/src/components/index/view_footer.nvue

@ -1,11 +1,11 @@
<template> <template>
<view class="footer-box"> <view class="footer-box">
<view class="f-user">
<view class="f-user" v-if="userLogin">
<!-- <image src="/static/index/camera_icon.png" mode="scaleToFill" /> --> <!-- <image src="/static/index/camera_icon.png" mode="scaleToFill" /> -->
<text class="txt">猫星人(18316553589)</text> <text class="txt">猫星人(18316553589)</text>
</view> </view>
<view class="f-line"></view>
<view class="f-vip-info" v-if="true">
<view class="f-line" v-if="userLogin"></view>
<view class="f-vip-info" v-if="userLogin">
<view class="f-coupon"> <view class="f-coupon">
<text class="txt1">优惠券:</text> <text class="txt1">优惠券:</text>
<text class="txt2">-¥</text> <text class="txt2">-¥</text>
@ -83,6 +83,7 @@ import util from "@/utils/util.js"
}) })
let userLogin = ref(false)
let inputValue = ref("") let inputValue = ref("")
let activeValue = ref("") let activeValue = ref("")

32
uniapp_project_code/src/components/index/view_header.nvue

@ -2,10 +2,10 @@
<view class="header-box" :style="[{ background: props.backgroundCustom }, getBorderStyle]"> <view class="header-box" :style="[{ background: props.backgroundCustom }, getBorderStyle]">
<view class="video-tip"> <view class="video-tip">
<image class="v-image" src="/static/index/camera_icon.png" mode="widthFix" /> <image class="v-image" src="/static/index/camera_icon.png" mode="widthFix" />
<text class="v-text">您已进入视频覆盖区{{ props.backgroundCustom }}</text>
<text class="v-text">您已进入视频覆盖区</text>
</view> </view>
<view class="cancel-button" @click="handle_closeUse"> <view class="cancel-button" @click="handle_closeUse">
<text class="v-text"> 取消交易</text>
<text class="v-text">{{countDown}} 取消交易</text>
</view> </view>
</view> </view>
</template> </template>
@ -13,6 +13,7 @@
<script setup> <script setup>
//触发自定义事件 //触发自定义事件
import util from "@/utils/util.js" import util from "@/utils/util.js"
import { ref,onMounted,onBeforeUnmount } from 'vue'
import { defineEmits, defineProps, computed } from 'vue' import { defineEmits, defineProps, computed } from 'vue'
const emits = defineEmits(['closeUse']) const emits = defineEmits(['closeUse'])
const props = defineProps({ const props = defineProps({
@ -26,6 +27,30 @@ const props = defineProps({
} }
}) })
const countDown = ref(90)
let timer = ref(null)
onMounted(async (res) => {
setCountDown()
})
onBeforeUnmount(() => {
clearInterval(timer)
timer = null
})
function setCountDown() {
clearInterval(timer)
timer = null
timer = setInterval(() => {
countDown.value--
if (countDown.value <= 1) {
clearInterval(timer)
timer = null
util.routeTo(`/pages/index/standby`, 'rL');
}
}, 1000)
}
const getBorderStyle = computed(() => { const getBorderStyle = computed(() => {
if (props.needBorder) { if (props.needBorder) {
return "border-bottom: 1rpx solid #F5F7F8;" return "border-bottom: 1rpx solid #F5F7F8;"
@ -35,6 +60,9 @@ const getBorderStyle = computed(() => {
}) })
const handle_closeUse = () => { const handle_closeUse = () => {
// clearInterval(timer)
// timer = null
util.routeTo(`/pages/index/standby`, 'rL'); util.routeTo(`/pages/index/standby`, 'rL');
// emits("closeUse", "false") // emits("closeUse", "false")
} }

18
uniapp_project_code/src/components/login/form.vue

@ -3,11 +3,19 @@
<view class="login-form"> <view class="login-form">
<view class="lf-item"> <view class="lf-item">
<image class="li-icon" mode="aspectFit" src="/static/images/person.png"></image> <image class="li-icon" mode="aspectFit" src="/static/images/person.png"></image>
<input class="li-ipt" placeholder="请输入登录账号" />
<input class="li-ipt" :value="props.brand_id" placeholder="请输入品牌ID"
@input="emit('update:brand_id', $event.detail.value)"/>
</view>
<view class="lf-item">
<image class="li-icon" mode="aspectFit" src="/static/images/person.png"></image>
<input class="li-ipt" :value="props.username" placeholder="请输入登录账号"
@input="emit('update:username', $event.detail.value)"/>
</view> </view>
<view class="lf-item"> <view class="lf-item">
<image class="li-icon" mode="aspectFit" src="/static/images/lock.png"></image> <image class="li-icon" mode="aspectFit" src="/static/images/lock.png"></image>
<input class="li-ipt" placeholder="请输入登录密码" />
<input class="li-ipt" type="safe-password"
:password="true" :value="props.password" placeholder="请输入登录密码"
@input="emit('update:password', $event.detail.value)"/>
</view> </view>
</view> </view>
</view> </view>
@ -15,6 +23,12 @@
</template> </template>
<script setup> <script setup>
import {
ref,
} from 'vue'
//define emits or props
const props = defineProps(['username','password','brand_id'])
const emit = defineEmits(['update:username','update:password','update:brand_id'])
</script> </script>

2
uniapp_project_code/src/components/login/logo.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="logo-box"> <view class="logo-box">
<image class="lb-img" mode="aspectFill"></image>
<image class="lb-img" mode="aspectFill" src="../../static/logo@2x.png"></image>
</view> </view>
</template> </template>

58
uniapp_project_code/src/components/login/pads_picker.vue

@ -3,9 +3,9 @@
<view class="pp-content"> <view class="pp-content">
<view class="pc-text">请选择平板</view> <view class="pc-text">请选择平板</view>
<view class="pc-frame"> <view class="pc-frame">
<picker class="pt-picker" mode="time">
<picker class="pt-picker" mode="selector" :range="padList" @change="padBindChange">
<view class="pp-box"> <view class="pp-box">
<view class="pb-text">请选择平板</view>
<view class="pb-text">{{ padList[selectIndex]|| '请选择平板'}}</view>
<image class="pt-icon" mode="aspectFtt" src="/static/images/triangle.png"></image> <image class="pt-icon" mode="aspectFtt" src="/static/images/triangle.png"></image>
</view> </view>
</picker> </picker>
@ -15,10 +15,60 @@
</view> </view>
</template> </template>
<script>
export default {
<script setup>
import {
onMounted,
ref,
watchEffect
} from 'vue'
const selectIndex = ref("");
//define emits or props
const emits = defineEmits(['pickerChange'])
const props = defineProps({
padList: {
type: Array,
default: []
},
padListOrigin: {
type: Array,
default: []
}
})
onMounted(() => {
});
watchEffect(() => {
console.log("watchEffect", props.padListOrigin)
if (props.padListOrigin.length > 0) {
autoShowBackStadium()
}
})
function padBindChange(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
let index = e.detail.value;
selectIndex.value = index;
emits("pickerChange", index)
}
function autoShowBackStadium(){
console.log("autoShowBackStadium")
let stadiumInfo = uni.getStorageSync("stadiumInfo")
if(stadiumInfo){
let index = props.padListOrigin.findIndex((e)=>{
return e.id == stadiumInfo.id
})
if(index != -1){
selectIndex.value = index
console.log("autoShowBackStadium set index: ",index)
}
}
} }
</script> </script>
<style lang="scss"> <style lang="scss">

33
uniapp_project_code/src/components/login/setting_mask.vue

@ -5,8 +5,8 @@
<view class="sc-title">平板信息配置</view> <view class="sc-title">平板信息配置</view>
<view class="sc-container"> <view class="sc-container">
<view class="sc-line"> <view class="sc-line">
<view class="sl-desc">当前设备名称前门平板</view>
<button class="sd-btn">更新配置</button>
<view class="sl-desc">当前设备名称收银端</view>
<button class="sd-btn" @click="logout">退出登录</button>
</view> </view>
<view class="sc-line"> <view class="sc-line">
<view class="sl-desc">屏幕适配设置</view> <view class="sl-desc">屏幕适配设置</view>
@ -24,6 +24,35 @@
emits("closeSetting","false") emits("closeSetting","false")
} }
const logout = ()=>{
console.log("logout")
uni.showModal({
title: '提示',
content: '确定退出登录?',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
handle_logout()
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
const handle_logout = ()=>{
getApp().globalData.stadiumInfo = {}
getApp().globalData.accountInfo = {}
uni.removeStorageSync("stadiumInfo")
uni.removeStorageSync("accountInfo")
uni.removeStorageSync("userInfo")
uni.reLaunch({
url: '/pages/login/index'
});
}
</script> </script>
<style lang="scss"> <style lang="scss">

4
uniapp_project_code/src/components/pay/paying.vue

@ -3,7 +3,7 @@
<text class="p-text">支付金额</text> <text class="p-text">支付金额</text>
<text class="p-total">{{props.payTotal||"0.00"}}</text>
<text class="p-total">{{payTotal||"0.00"}}</text>
<view class="p-zhichi"> <view class="p-zhichi">
<view class="p-line"></view> <view class="p-line"></view>
@ -27,7 +27,7 @@
<view class="p-user"> <view class="p-user">
<text class="p-txt">猫星人18316553589</text>
<text class="p-txt">未登录00000000000</text>
</view> </view>
</view> </view>

7
uniapp_project_code/src/pages.json

@ -1,24 +1,25 @@
{ {
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages "pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{ {
"path": "pages/index/standby",
"path": "pages/login/index",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/index/index",
"path": "pages/index/standby",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/login/index",
"path": "pages/index/index",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/pay/index", "path": "pages/pay/index",
"style": { "style": {

4
uniapp_project_code/src/pages/index/-index.nvue

@ -111,9 +111,9 @@ import { uni } from "@dcloudio/uni-h5";
console.log("onload:",res) console.log("onload:",res)
await this.updateGoodsList() await this.updateGoodsList()
// let skulist = this.searchGoodBySku("1000000001") // let skulist = this.searchGoodBySku("1000000001")
let skulist = await this.searchGoodBySku("10000012")
// let skulist = await this.searchGoodBySku("10000012")
//将skulist合并到shopList //将skulist合并到shopList
this.shopList = this.shopList.concat(skulist)
// this.shopList = this.shopList.concat(skulist)
console.log("skulist:",this.shopList) console.log("skulist:",this.shopList)
// this.test() // this.test()

15
uniapp_project_code/src/pages/index/index.vue

@ -136,17 +136,16 @@
console.log("skulist:", this.shopList) console.log("skulist:", this.shopList)
}) })
console.log("test set SKU 10000012")
let skulist = await this.searchGoodBySku("10000012")
//skulistshopList
this.shopList = this.shopList.concat(skulist)
this.setFooterHeight() this.setFooterHeight()
console.log("test set SKU 10000012")
// let skulist = await this.searchGoodBySku("10000012")
// this.shopList = this.shopList.concat(skulist)
}, 1000) }, 1000)
}, },
methods: { methods: {
clickToPay() { clickToPay() {
// shopList { // shopList {
// "id": 57, // "id": 57,
// "name": "", // "name": "",
@ -170,6 +169,10 @@
shopListTotalPrice: this.shopListTotalPrice, shopListTotalPrice: this.shopListTotalPrice,
shopListTotalCount: this.shopListTotalCount shopListTotalCount: this.shopListTotalCount
} }
console.log("clickToPay", _query)
if(this.shopListTotalPrice<=0){
return util.showNone("请先添加商品")
}
util.routeTo(`/pages/pay/index?query=${JSON.stringify(_query)}`, 'nT'); util.routeTo(`/pages/pay/index?query=${JSON.stringify(_query)}`, 'nT');
}, },
clickToUse() { clickToUse() {
@ -188,7 +191,7 @@
this.showEndPhoneBox = !this.showEndPhoneBox this.showEndPhoneBox = !this.showEndPhoneBox
}, },
handle_clickQR() { handle_clickQR() {
util.showNone("输入条形码")
// util.showNone("")
this.showQRInputBox = !this.showQRInputBox this.showQRInputBox = !this.showQRInputBox
}, },
handle_clickCommit_qr(res) { handle_clickCommit_qr(res) {

2
uniapp_project_code/src/pages/index/standby.nvue

@ -1,6 +1,6 @@
<template> <template>
<view> <view>
<page-standby @click="toIndex"></page-standby>
<page-standby ></page-standby>
</view> </view>
</template> </template>

104
uniapp_project_code/src/pages/login/index.vue

@ -6,7 +6,11 @@
</view> </view>
<view class="li-name">欢迎使用欧轩智能场馆平板端系统</view> <view class="li-name">欢迎使用欧轩智能场馆平板端系统</view>
<view class="li-from"> <view class="li-from">
<login-form></login-form>
<login-form
:username="username" @update:username="update_username"
:password="password" @update:password="update_password"
:brand_id="brand_id" @update:brand_id="update_brand_id"
></login-form>
</view> </view>
<view class="li-tip">*登录账号密码请从pc端后台管理设备运营管理平板管理里获取</view> <view class="li-tip">*登录账号密码请从pc端后台管理设备运营管理平板管理里获取</view>
@ -25,10 +29,108 @@
import loginButton from '@/components/login/button.vue'; import loginButton from '@/components/login/button.vue';
import util from "@/utils/util.js" import util from "@/utils/util.js"
import {
API
} from "@/utils/api";
import {
ox
} from "@/utils/server";
import {
onMounted,
ref,
} from 'vue'
import { onLoad,onReady } from '@dcloudio/uni-app';
onReady(async () => {
autoLogin()
});
// import { uni } from '@dcloudio/uni-h5';
const username = ref('');
const password = ref('');
const brand_id = ref('');
const update_username = (val)=>{username.value = val}
const update_password = (val)=>{password.value = val}
const update_brand_id = (val)=>{brand_id.value = val}
//,,
function clickLogin(){ function clickLogin(){
//
// saveUserInfo({username:username.value,password:password.value,brand_id:brand_id.value})
// return
util.showLoad('登录中...');
let urlParams = {
assistant_client: 'pc',
brand_id:brand_id.value,
username: username.value,
password: password.value
}
ox.post({
url: API.padLogin,
data: urlParams,
isDefaultGet: true,
failMsg: '操作失败!'
})
.then(data => {
util.hideLoad();
console.log("padLogin suc: ", data)
//,
let {token,role} = data
let autoLogin = getApp().globalData.autoLogin
let stadiumInfo = uni.getStorageSync('stadiumInfo');
saveUserInfo({username:username.value,password:password.value,brand_id:brand_id.value,token,role})
//
if(autoLogin&&stadiumInfo){
getApp().globalData.autoLogin = false
setTimeout(()=>{
util.routeTo(`/pages/index/index`, 'nT');
},1000)
return util.showNone("自动登录成功")
}else{
getApp().globalData.autoLogin = false
setTimeout(()=>{
util.routeTo(`/pages/login/success`, 'nT'); util.routeTo(`/pages/login/success`, 'nT');
},1000)
return util.showNone("自动登录成功,请先选择门店")
} }
return data
}).finally(()=>{
util.hideLoad();
})
}
function saveUserInfo(userInfo){
uni.setStorageSync('userInfo', userInfo);
getApp().globalData.accountInfo.brand_id = userInfo.brand_id
getApp().globalData.accountInfo.username = userInfo.username
getApp().globalData.accountInfo.password = userInfo.password
getApp().globalData.accountInfo.token = userInfo.token
getApp().globalData.accountInfo.role = userInfo.role
console.log('存储到本地localStorage '+uni.getStorageSync('userInfo').username)
}
function autoLogin(){
let userInfo = uni.getStorageSync('userInfo');
console.log(`page-onReady autoLogin userInfo: `,userInfo||"none")
if(userInfo){
username.value = userInfo.username
password.value = userInfo.password
brand_id.value = userInfo.brand_id
clickLogin()
}
}
</script> </script>
<style lang="scss"> <style lang="scss">

65
uniapp_project_code/src/pages/login/success.vue

@ -7,13 +7,14 @@
<view class="ld-line">欢迎登录欧轩智能场馆平板端系统</view> <view class="ld-line">欢迎登录欧轩智能场馆平板端系统</view>
</view> </view>
<view class="ls-pads"> <view class="ls-pads">
<pads-picker></pads-picker>
<pads-picker :padList="padList" :padListOrigin="padListOrigin" @pickerChange="handle_pickerChange"></pads-picker>
</view> </view>
<view class="ls-botton"> <view class="ls-botton">
<login-button @click="clickJumpIndex">进入使用</login-button> <login-button @click="clickJumpIndex">进入使用</login-button>
</view> </view>
<view class="ls-links"> <view class="ls-links">
<view class="ll-item" @click="clickUpdate">更新</view> <view class="ll-item" @click="clickUpdate">更新</view>
<view class="ll-item" @click="clickUpdatePadList">更新门店</view>
<view class="ll-item" @click="clickSetting">设置</view> <view class="ll-item" @click="clickSetting">设置</view>
</view> </view>
</view> </view>
@ -29,14 +30,30 @@ import loginButton from '@/components/login/button.vue';
import settingMask from '@/components/login/setting_mask.vue'; import settingMask from '@/components/login/setting_mask.vue';
import { ref } from 'vue' import { ref } from 'vue'
import { onReady } from '@dcloudio/uni-app';
import util from "@/utils/util.js" import util from "@/utils/util.js"
import {API} from "@/utils/api";
import {ox} from "@/utils/server";
let showSettingMask = ref(true)
let showSettingMask = ref(false)
const padList = ref([])
const selectIndex = ref("")
const padListOrigin = ref([])
onReady(async () => {
updatePadList()
});
function handle_closeSetting(val){ function handle_closeSetting(val){
console.log("handle_closeSetting",val) console.log("handle_closeSetting",val)
showSettingMask.value = !showSettingMask.value showSettingMask.value = !showSettingMask.value
} }
function handle_pickerChange(val){
console.log("handle_pickerChange",val)
selectIndex.value = val
saveStadiumInfo(val)
}
function clickJumpIndex(){ function clickJumpIndex(){
util.routeTo(`/pages/index/index`, 'nT'); util.routeTo(`/pages/index/index`, 'nT');
@ -47,6 +64,50 @@ function clickSetting(){
function clickUpdate(){ function clickUpdate(){
util.showNone("更新功能暂不可用") util.showNone("更新功能暂不可用")
} }
function clickUpdatePadList(){
console.log("clickUpdatePadList")
updatePadList()
}
function saveStadiumInfo(val){
let item = padListOrigin.value[val]
let {id:stadium_id} = item
getApp().globalData.accountInfo.store_id = stadium_id
getApp().globalData.stadiumInfo = item
uni.setStorageSync("stadiumInfo",item)
}
function updatePadList(){
console.log("updatePadList")
util.showLoad('更新门店列表...');
let {brand_id,token} = getApp().globalData.accountInfo
let urlParams = {
brand_id,token,
page: 1,
page_size: 200
}
ox.get({
url: API.padList,
data: urlParams,
isDefaultGet: true,
failMsg: '操作失败!'
})
.then(data => {
util.hideLoad();
console.log("updatePadList suc: ", data)
padListOrigin.value = data.list
padList.value = data.list.map((e)=>{
return e.venue_name
})
return data
}).finally(()=>{
util.hideLoad();
})
}
</script> </script>

9
uniapp_project_code/src/pages/pay/index.vue

@ -4,7 +4,7 @@
<view v-if="paySuccessStatus==0"> <view v-if="paySuccessStatus==0">
<view-header class="mheader" :backgroundCustom="('none')" :needBorder="(false)" <view-header class="mheader" :backgroundCustom="('none')" :needBorder="(false)"
@closeUse=""></view-header> @closeUse=""></view-header>
<paying v-if="true" @clickVipCard="handle_clickVipCard"></paying>
<paying v-if="true" :payTotal="payTotal" @clickVipCard="handle_clickVipCard"></paying>
</view> </view>
<pay-success v-else></pay-success> <pay-success v-else></pay-success>
@ -43,6 +43,12 @@
'input-qr-box': inputQrBox, 'input-qr-box': inputQrBox,
'keyboard-listener': keyboardListener, 'keyboard-listener': keyboardListener,
}, },
computed: {
payTotal() {//
let _payTotal = this.dataQuery.amount
return _payTotal.toFixed(2)||"0.00"
}
},
watch:{ watch:{
}, },
@ -77,6 +83,7 @@
} }
console.log("setPayData2:",_data) console.log("setPayData2:",_data)
this.dataQuery = _data this.dataQuery = _data
}, },
// 101112131415WECHAT_MICROPAY,28ALI_BARCODEPAY // 101112131415WECHAT_MICROPAY,28ALI_BARCODEPAY
getPayType(code){ getPayType(code){

BIN
uniapp_project_code/src/static/logo@2x.png

After

Width: 338  |  Height: 337  |  Size: 20 KiB

4
uniapp_project_code/src/utils/server.js

@ -10,7 +10,7 @@ export class Server {
// if(method === 'POST'&&_token)url = url + `?token=${_token}` // if(method === 'POST'&&_token)url = url + `?token=${_token}`
uni.request({ uni.request({
url, url,
timeout: 60000,
timeout: 20000,
sslVerify:false, sslVerify:false,
data, data,
method, // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT method, // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
@ -36,6 +36,7 @@ export class Server {
} }
if(islog){ if(islog){
console.log('islog req success---->')
let weburl = getWebURL(data,url) let weburl = getWebURL(data,url)
let temp = url.split("?")[0].split("/") let temp = url.split("?")[0].split("/")
let postName = temp[temp.length-1] let postName = temp[temp.length-1]
@ -64,6 +65,7 @@ export class Server {
// if(util.debug){ // if(util.debug){
util.showLog(data,url,result) util.showLog(data,url,result)
// } // }
} }
}) })

2
uniapp_project_code/src/utils/util.js

@ -6,7 +6,7 @@ export const specialReg = new RegExp("[^a-zA-Z0-9\_\u4e00-\u9fa5]","i");
export const debug = false //是否开启debug模式,使用非离线工程模式调试 export const debug = false //是否开启debug模式,使用非离线工程模式调试
export const isExportLog = false //是否开启log输出
export const isExportLog = true //是否开启log输出
export const formatTime = date => { export const formatTime = date => {
const year = date.getFullYear() const year = date.getFullYear()

Loading…
Cancel
Save