Browse Source

接口对接、交互修改

master
zq 3 months ago
parent
commit
cae9d3cf9a
  1. 106
      components/pageBottomBtn.vue
  2. 202
      components/visitorInfo.vue
  3. 29
      main.js
  4. 3
      pages.json
  5. 59
      pages/coinsDetail/index.vue
  6. 449
      pages/home/index.vue
  7. BIN
      static/images/qrcode_get.png

106
components/pageBottomBtn.vue

@ -0,0 +1,106 @@
<template>
<view class="page-bottom-btn-container flex">
<button
class="bottom-btn cancel"
:class="{ disabled: disabled }"
@click="cancelClick"
v-if="showCancel"
>
{{ cancelTxt }}
</button>
<button
class="bottom-btn PfScMedium primary"
:class="{ disabled: disabled }"
@click="handleClick"
>
{{ text }}
</button>
</view>
</template>
<script>
export default {
name: 'PageBottomBtn',
props: {
text: {
type: String,
default: '确认选择'
},
cancelTxt: {
type: String,
default: '取消'
},
disabled: {
type: Boolean,
default: false
},
showCancel: {
type: Boolean,
default: false
}
},
data() {
return {
}
},
mounted() {
},
methods: {
handleClick() {
if (!this.disabled) this.$emit('click')
},
cancelClick() {
if (!this.disabled) this.$emit('cancelClick')
}
}
}
</script>
<style lang="scss" scoped>
.page-bottom-btn-container {
position: fixed;
left: 0;
right: 0;
bottom: 0;
width: 100%;
box-sizing: border-box;
background-color: #FFFFFF;
padding: 0rpx 54rpx;
box-shadow: 0px -2rpx 6rpx 0rpx rgba(181, 181, 181, 0.1319);
z-index: 9;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
column-gap: 50rpx;
}
.bottom-btn {
height: 92rpx;
width: 100%;
margin: 16rpx 0;
line-height: 92rpx;
text-align: center;
font-size: 32rpx;
border-radius: 16rpx;
border: none;
padding: 0;
&.primary{
background-color: #39D067;
color: #FFFFFF;
}
&.cancel{
background-color: #F1F2F3;
color: #616266;
}
&::after {
border: none;
}
&.disabled {
background-color: #CCCCCC;
opacity: 0.7;
}
}
</style>

202
components/visitorInfo.vue

@ -0,0 +1,202 @@
<template>
<view class="user-info-com" @click="$emit('click')">
<view class="user-info">
<view class="user-top">
<view class="user-left">
<view class="user-name PfScSemibold ft38">{{ visitorInfo.coin_name }}</view>
<view class="user-num">{{ visitorInfo.year }}</view>
</view>
<view class="user-right" v-if="visitorInfo.status" :class="className[visitorInfo.status]">{{ descObj[visitorInfo.status] }}</view>
<view class="user-right" v-else :class="className[visitorInfo.ancient_coin_status]">{{ visitorInfo.ancient_coin_status_desc }}</view>
</view>
<view class="user-bottom gap24 flex-between">
<view>板式{{ visitorInfo.format }}</view>
<view v-if="visitorInfo.operate_time">{{ visitorInfo.operate_time }} </view>
</view>
</view>
</view>
</template>
<script>
export default {
name: "visitorInfo",
data() {
return {
cssUrl: this.cssUrl,
className: {
0: 'notStore',//
'1': 'inventory',//
'2': 'outBound'//
},
descObj: {
0: '未入库',//
'1': '库存',//
'2': '已出库'//
},
}
},
props: {
visitorInfo: {
type: Object,
// default: () => ({
// name: '',
// year: '1889',
// phone: '1310684212',
// id: 3,
// time: '2025.12.21 13:23',
// address: '',
// plateType:'广',
// type: '1'
// })
},
},
methods: {
resetUinfo() {
this.$emit('resetUinfo')
}
}
}
</script>
<style scoped lang="scss">
.user-info-com {
font-family: PingFang SC;
.user-info {
margin: 0 18rpx 20rpx;
background: #FFFFFF;
padding: 34rpx 24rpx 44rpx;
position: relative;
.user-bg {
position: absolute;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
z-index: 1;
}
}
.gap24 {
gap: 24rpx;
}
.phone {
display: flex;
align-items: center;
height: 39rpx;
line-height: 39rpx;
img {
width: 34rpx;
height: 34rpx;
margin-left: 12rpx;
}
}
.user-top,
.user-bottom {
position: relative;
display: flex;
justify-content: space-between;
z-index: 8;
}
.user-top {
display: flex;
justify-content: space-between;
align-items: center;
}
.user-left {
display: flex;
align-items: center;
padding-left: 20rpx;
&::before{
content: '';
display: block;
position: absolute;
width: 8rpx;
height: 34rpx;
border-radius: 10rpx;
background: #58CA7F;
left: 0;
top: 8rpx;
}
}
.user-name {
font-size: 38rpx;
color: #333333;
line-height: 50rpx;
}
.user-num {
margin-left: 24rpx;
font-size: 28rpx;
color: #79624A;
line-height: 40rpx;
font-size: 28rpx;
font-weight: normal;
line-height: 44rpx;
letter-spacing: 0.86rpx;
color: #242833;
}
.user-right {
font-size: 26rpx;
text-align: center;
letter-spacing: 0.69rpx;
color: #999999;
line-height: 36rpx;
border-radius: 6rpx;
background: #FCFCFC;
border: 1.5rpx solid #999999;
padding: 2rpx 18rpx;
}
.notStore{
color: #999999;
background: #FCFCFC;
border-color: #999999;
}
.inventory{
color: #5FA1CB;
background: #F7FCFF;
border-color: #5FA1CB;
}
.outBound{
color: #58CA7F;
background: #F8FFF7;
border-color: #5FA1CB;
}
.user-bottom {
margin-top: 32rpx;
display: flex;
align-items: center;
font-size: 28rpx;
font-weight: normal;
line-height: normal;
letter-spacing: 0.86rpx;
color: #999999;
}
.user-card {
font-size: 30rpx;
color: #949699;
line-height: 36rpx;
}
.user-last-time {
font-size: 30rpx;
color: #949699;
line-height: 36rpx;
}
}
</style>

29
main.js

@ -152,15 +152,18 @@ try{
Vue.prototype.isMobile = isMobile(); Vue.prototype.isMobile = isMobile();
} }
// const NODE_ENV = 'development'; const NODE_ENV = 'development';
const NODE_ENV = 'production'; // const NODE_ENV = 'production';
if(Vue.prototype.provider == Vue.prototype.provider_weixin){ if(Vue.prototype.provider == Vue.prototype.provider_weixin){
if (NODE_ENV == "development") { if (NODE_ENV == "development") {
Vue.prototype.request_domain = 'http://jasonyizherenxin.checkcopy.com/'; Vue.prototype.request_domain = 'http://coin.checkcopy.com/';
Vue.prototype.cssUrl = '/static/images/'
// Vue.prototype.request_domain = 'http://jasonyizherenxin.checkcopy.com/';
} else { } else {
Vue.prototype.request_domain = 'https://api.yizherenxin.cn/'; Vue.prototype.request_domain = 'https://api.yizherenxin.cn/';
} }
Vue.prototype.cssUrl = Vue.prototype.request_domain + '/images/frontend/user/'; // 暂时注释
// Vue.prototype.cssUrl = Vue.prototype.request_domain + '/images/frontend/user/';
}else{ }else{
if(NODE_ENV == 'development'){ if(NODE_ENV == 'development'){
Vue.prototype.request_domain = "http://jasonyizherenxin.checkcopy.com/"; Vue.prototype.request_domain = "http://jasonyizherenxin.checkcopy.com/";
@ -183,7 +186,7 @@ if(Vue.prototype.provider == Vue.prototype.provider_weixin) {
Vue.prototype.View = currentPageView+'New'; Vue.prototype.View = currentPageView+'New';
} }
const CODE_SUCCESS = 0; const CODE_SUCCESS = 200;
const CODE_ERROR = 40001; const CODE_ERROR = 40001;
const CODE_LOGIN_EXIPRE = 40002; const CODE_LOGIN_EXIPRE = 40002;
@ -222,7 +225,7 @@ function req(url, data={}, method = 'POST', header={}) {
var isNeedLogin = !noNeedLoginFunc.includes(url); var isNeedLogin = !noNeedLoginFunc.includes(url);
var headerObj = {'content-type': 'application/x-www-form-urlencoded'}; var headerObj = {'content-type': 'application/x-www-form-urlencoded'};
var token = getToken(); var token = uni.getStorageSync("u_token");
if(token) headerObj.AUTH = token if(token) headerObj.AUTH = token
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@ -260,8 +263,7 @@ function req(url, data={}, method = 'POST', header={}) {
}); });
return; return;
} }
if(data.xcx_scource == Vue.prototype.USER_SOURCE_WX_XCX && !data.repeat && rdata.code==CODE_LOGIN_EXIPRE && url != '/api/login'){
if(data.xcx_scource == Vue.prototype.USER_SOURCE_WX_XCX && !data.repeat && rdata.code==CODE_LOGIN_EXIPRE && url != '/api/common/xcx_login'){
removeLogin(); removeLogin();
xcx_login(url, data, method).then(data=>{ xcx_login(url, data, method).then(data=>{
return resolve(data); return resolve(data);
@ -328,12 +330,15 @@ function xcx_login(url, eqdata={}, method = 'POST') {
pdata.code = res.code; pdata.code = res.code;
var doctor_id = uni.getStorageSync('doctor_id'); var doctor_id = uni.getStorageSync('doctor_id');
pdata.state = 'user-'+doctor_id; pdata.state = 'user-'+doctor_id;
debugger
req('/api/common/xcx_login', pdata).then(data=>{ req('/api/login', pdata).then(data=>{
var udata = data var udata = data
console.log(data,'===2222');
if(udata && udata.jwttoken) { if(udata && udata.jwttoken) {
setToken(udata.jwttoken) uni.setStorageSync("u_token", udata.jwttoken)
setUinfo(JSON.stringify(udata))
// setToken(udata.jwttoken)
// setUinfo(JSON.stringify(udata))
} }
pdata.repeat = 1; pdata.repeat = 1;

3
pages.json

@ -4,6 +4,7 @@
"style": { "style": {
"navigationBarTitleText": "出入库", "navigationBarTitleText": "出入库",
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
"onReachBottomDistance": 50,
"app-plus": { "app-plus": {
"titleNView": false "titleNView": false
} }
@ -13,7 +14,7 @@
"path": "pages/coinsDetail/index", "path": "pages/coinsDetail/index",
"style": { "style": {
"navigationBarTitleText": "出入库详情", "navigationBarTitleText": "出入库详情",
"enablePullDownRefresh": true, "enablePullDownRefresh": false,
"app-plus": { "app-plus": {
"titleNView": false "titleNView": false
} }

59
pages/coinsDetail/index.vue

@ -2,16 +2,16 @@
<view class="coinsDetail-wrap"> <view class="coinsDetail-wrap">
<!-- :visitorInfo="visitorInfo" --> <!-- :visitorInfo="visitorInfo" -->
<view style="margin-top: 20rpx;"> <view style="margin-top: 20rpx;">
<VisitorInfo /> <VisitorInfo :visitorInfo="detailItem"/>
</view> </view>
<view class="list-wrap"> <view class="list-wrap">
<ListBox leftTitle="评级部门" :rightTitle="detailItem.name" /> <ListBox leftTitle="评级部门" :rightTitle="detailItem.rating_department" />
<ListBox leftTitle="评级编号" :rightTitle="detailItem.num" /> <ListBox leftTitle="评级编号" :rightTitle="detailItem.rating_code" />
<ListBox leftTitle="分数" :rightTitle="detailItem.count" /> <ListBox leftTitle="分数" :rightTitle="detailItem.grade" />
<ListBox leftTitle="尺寸" :rightTitle="detailItem.size" /> <ListBox leftTitle="尺寸" :rightTitle="detailItem.size" />
<!-- 详情页面展示 --> <!-- 详情页面展示 -->
<ListBox v-if="id" leftTitle="操作人" :rightTitle="detailItem.operate" /> <ListBox v-if="id" leftTitle="操作人" :rightTitle="detailItem.operator" />
</view> </view>
</view> </view>
@ -30,35 +30,48 @@ export default {
data() { data() {
return { return {
visitorInfo: {}, visitorInfo: {},
id:'',
detailItem: { detailItem: {
name: '北京公博二部', // "rating_agency_id": "1", //id
num: '1310684212', // "coin_name": "", //
count: 'AU 58', // "rating_code": "1310684212", //
size: '24.0*1.1mm,3.5g', // "rating_department": "", //
operate: '泅渡' // "grade": "AU 58", //
// "size": "24.0*1.1mm,3.5g", //
// "year": "1889", //
// "format": "广", //
// "ancient_coin_status": 0, //
// "ancient_coin_status_desc": "" //
}, },
id:'' scan_code_detail:''
}
},
watch: {
scanCodeDetail(newVal, oldVal) {
// console.log('someProp changed:', newVal, 'from', oldVal);
this.detailItem = {...newVal}//
}
},
mounted(){
if(Object.keys(this.scanCodeDetail).length > 0){
this.detailItem = {...this.scanCodeDetail}
} }
}, },
onLoad(options) { onLoad(options) {
console.log(options,'this.$route.query-='); // console.log(options,'this.$route.query-=',this.scanCodeDetail);
const {id} = options; const {id} = options;
// //
if(id){ if(id){
this.id = id; this.id = id;
}else{ let detailItem = uni.getStorageSync('detail')
// if (detailItem)this.detailItem = JSON.parse(detailItem)
// scanCodeDetail props
this.detailItem = {...this.scanCodeDetail}
} }
// this.getDetail() // else{
// //
// // scanCodeDetail props
// this.detailItem = {...this.scanCodeDetail}
// }
}, },
methods: {
//
getDetail(){
}
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

449
pages/home/index.vue

@ -1,25 +1,30 @@
<!-- <template> <template>
<!-- <view style="height:100vh">
<Mescroll @resultEvent="getList" ref="scroll" rqurl="/api/getlist">
<template v-slot:list> -->
<view class="home-wrap"> <view class="home-wrap">
<view class="amountWrap flex"> <view class="amountWrap flex">
<view class="amountLeft flex"> <view class="amountLeft flex">
<view class="amountName">库存件数</view> <view class="amountName">库存件数</view>
<view class="remain">190009</view> <view class="remain">{{ storage_count || 0 }}</view>
</view> </view>
<view class="amountRight flex"> <view class="amountRight flex">
<view class="amountName">出库件数</view> <view class="amountName">出库件数</view>
<view class="outbound">1009</view> <view class="outbound">{{ delivery_count || 0 }}</view>
</view> </view>
</view> </view>
<view class="patientTab"> <view class="patientTab">
<view :class="'notActive ft32' + (wait_type == '0' ? ' active PfScMedium' : '')" <view :class="'notActive ft32' + (status == '1' ? ' active PfScMedium' : '')"
@click="changeWaitType('0')">库存列表</view>
<view :class="'notActive ft32' + (wait_type == '1' ? ' active PfScMedium' : '')"
@click="changeWaitType('1')"> @click="changeWaitType('1')">
库存列表</view>
<view :class="'notActive ft32' + (status == '2' ? ' active PfScMedium' : '')"
@click="changeWaitType('2')">
出库列表 出库列表
</view> </view>
</view> </view>
<view class="patient-type-tab1">
<!-- <view class="patient-type-tab1"> -->
<scroll-view class="patient-type-tab1" @scrolltolower="onScroll" scroll-y>
<view class="bed-wait-container"> <view class="bed-wait-container">
<view class="bed-wait-list"> <view class="bed-wait-list">
<view class="bed-wait-item" v-for="(item, index) in bedWaitList" :key="index" <view class="bed-wait-item" v-for="(item, index) in bedWaitList" :key="index"
@ -27,159 +32,82 @@
<view class="bed-wait-info"> <view class="bed-wait-info">
<view class="bed-wait-name PfScMedium">{{ item.name }}</view> <view class="bed-wait-name PfScMedium">{{ item.coin_name }}</view>
<view class="bed-sex">{{ item.year }}</view> <view class="bed-sex">{{ item.year }}</view>
<view :class="'bed-desc'"> <view :class="'bed-desc'">
{{ item.phone }} {{ item.rating_code }}
</view> </view>
</view> </view>
<view class="bed-wait-time flex-between"> <view class="bed-wait-time flex-between">
<view class="bed-visit-time">{{ item.time }}</view> <view class="bed-visit-time">{{ item.operate_time }}</view>
<view class="bed-checkin-time">{{ item.address }}</view> <view class="bed-checkin-time">{{ item.rating_department }}</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view v-if="loading" class="loading-text">加载中...</view>
<view class="page-padding" v-show="bedWaitList && bedWaitList.length && bedWaitList.length > 0"></view> <view v-if="noMore" class="no-more-text">没有更多数据了</view>
<view class="page-padding" v-show="bedWaitList && bedWaitList.length && bedWaitList.length > 0">
</view> </view>
</scroll-view>
<!-- </view> -->
<view class="qrcode_wrap"> <view class="qrcode_wrap">
<img :src="cssUrl + 'qrcode_get.png'" alt="" @click="scanQrcode"> <img :src="cssUrl + 'qrcode_get.png'" alt="" @click="scanQrcode">
</view> </view>
<!-- <button @click="scanQrcode">哈哈哈</button> -->
<PopUpCommon ref="coinsPopup" :showClose="true" zIndex="top">
<view class="popWrap">
<view class="pop-title PfScMedium">{{ titleType[scanCodeDetail.ancient_coin_status] }}</view>
<view class="content">
<CoinsDetail :scanCodeDetail="scanCodeDetail" />
</view>
<PageBottomBtn :text="btnText[scanCodeDetail.ancient_coin_status]" cancelTxt="取消" @click="onConfirm"
@cancelClick="onCancel" :show-cancel="true" />
</view> </view>
</PopUpCommon>
</view>
<!-- </template>
</Mescroll>
</view> -->
</template> </template>
<script> <script>
// import PopUpCommon from '@/components/common/popUpCommon.vue';
// import PageBottomBtn from '@/components/new/pageBottomBtn.vue'
import ListBox from '@/components/listBox.vue'; import ListBox from '@/components/listBox.vue';
import PopUpCommon from '@/components/common/popUpCommon.vue';
import CoinsDetail from '../coinsDetail'; import CoinsDetail from '../coinsDetail';
import PageBottomBtn from '@/components/pageBottomBtn.vue'
import Mescroll from '@/components/common/mescroll.vue'
export default { export default {
options: { styleIsolation: "shared" }, options: { styleIsolation: "shared" },
components: { components: {
// PopUpCommon, PopUpCommon,
// PageBottomBtn, PageBottomBtn,
Mescroll,
ListBox, ListBox,
CoinsDetail CoinsDetail
}, },
data() { data() {
return { return {
cssUrl: this.cssUrl, cssUrl: this.cssUrl,
wait_type: '0', status: '1',
bedWaitList: [ bedWaitList: [],
{
name: '机制光绪通宝',
year: '1889年',
phone: '1310684212',
id: 1,
time: '2025.12.21 13:23',
address: '北京公博二部'
},
{
name: '机制光绪通宝',
year: '1889年',
phone: '1310684212',
id: 2,
time: '2025.12.21 13:23',
address: '北京公博二部'
},
{
name: '机制光绪通宝',
year: '1889年',
phone: '1310684212',
id: 3,
time: '2025.12.21 13:23',
address: '北京公博二部'
},
{
name: '机制光绪通宝',
year: '1889年',
phone: '1310684212',
id: 1,
time: '2025.12.21 13:23',
address: '北京公博二部'
},
{
name: '机制光绪通宝',
year: '1889年',
phone: '1310684212',
id: 2,
time: '2025.12.21 13:23',
address: '北京公博二部'
},
{
name: '机制光绪通宝',
year: '1889年',
phone: '1310684212',
id: 3,
time: '2025.12.21 13:23',
address: '北京公博二部'
},
{
name: '机制光绪通宝',
year: '1889年',
phone: '1310684212',
id: 1,
time: '2025.12.21 13:23',
address: '北京公博二部'
},
{
name: '机制光绪通宝',
year: '1889年',
phone: '1310684212',
id: 2,
time: '2025.12.21 13:23',
address: '北京公博二部'
},
{
name: '机制光绪通宝',
year: '1889年',
phone: '1310684212',
id: 3,
time: '2025.12.21 13:23',
address: '北京公博二部'
},
{
name: '机制光绪通宝',
year: '1889年',
phone: '1310684212',
id: 1,
time: '2025.12.21 13:23',
address: '北京公博二部'
},
{
name: '机制光绪通宝',
year: '1889年',
phone: '1310684212',
id: 2,
time: '2025.12.21 13:23',
address: '北京公博二部'
},
{
name: '机制光绪通宝',
year: '1889年',
phone: '1310684212',
id: 3,
time: '2025.12.21 13:23',
address: '北京公博二部'
},
],
titleType: { titleType: {
'1':'扫码入库', 0: '扫码入库',
'2':'扫码出库', '1': '扫码出库',
'3':'出库信息', '2': '出库信息',
}, },
btnText: { btnText: {
'1':'入库', 0: '入库',
'2':'出库', '1': '出库',
'2': '再次入库',
}, },
coinsType:'1',//
detailItem: { detailItem: {
name: '北京公博二部', name: '北京公博二部',
num: '1310684212', num: '1310684212',
@ -188,70 +116,109 @@ export default {
operate: '泅渡' operate: '泅渡'
}, },
code: '', code: '',
state:'' state: '',
storage_count: '',
delivery_count: '',
scanCodeDetail: {
ancient_coin_status: 0,
ancient_coin_status_desc: "未入库",
coin_name: "机制光绪通宝",
format: "库平一钱满汉广",
grade: "AU 58",
rating_agency_id: "1",
rating_code: "1310684212",
rating_department: "北京公博二部",
size: "24.0*1.1mm,3.5g",
year: "1889"
},
loading:false,
noMore:false,
page:1,
pagesize:7
} }
}, },
onLoad(option) { onLoad(option) {
// var token = uni.getStorageSync("u_token"); // var token = uni.getStorageSync("u_token");
// if(option.code && option.state) {
// this.code = option.code
// this.state = option.state
// }
// //
this.getCoinsList() this.getCoinsList()
// this.$refs.coinsPopup.openPop();
},
onPullDownRefresh() {
this.bedWaitList = [];
this.page = 1;
this.getCoinsList()
},
onReachBottom() {
// debugger
if (!this.noMore && !this.loading) {
this.page++;
this.getCoinsList();
}
}, },
methods: { methods: {
onScroll(){
console.log(this.noMore,'000',this.loading,'this.loading==');
if (!this.noMore && !this.loading) {
this.page++;
this.getCoinsList();
}
},
getList(e){
console.log(e,'=====eeee');
},
getCoinsList() { getCoinsList() {
this.loading = true;
// //
// const res = await this.$request({ this.$http.req('/api/getlist', { status: this.status, page: this.page, pagesize: this.pagesize}, 'POST').then(data => {
// url: '/getlist', uni.stopPullDownRefresh();
// method: 'POST', this.loading = false;
// data: { if ( data.list.length === 0 || data.length == 0 ) {
// type:this.wait_type this.noMore = true;
// } uni.showToast({ title: '没有更多数据了', icon: 'none' });
// }); return;
// if (res.code !== 0) { }
// this.$pop.modelShow(res.msg) //
// return; if (this.page === 1) {
// } this.bedWaitList = data.list;
this.$http.req('api/getlist',{status:'1',page:1,pagesize:10}, 'POST').then(data=>{ } else {
console.log(data,'===='); this.bedWaitList = [...this.bedWaitList, ...data.list];
}
this.storage_count = data.storage_count;
this.delivery_count = data.delivery_count;
}).catch(res=>{
this.loading = false;
}); });
// this.bedWaitList = res.data;
}, },
lookDetail(item) { lookDetail(item) {
let url = `/pages/coinsDetail/index?id=${item.id}` uni.setStorageSync('detail',JSON.stringify(item))
// let url = `/pages/coinsDetail/index`
let url = `/pages/coinsDetail/index?id=${item.rating_code}`
this.$nav.navToPath(url) this.$nav.navToPath(url)
}, },
changeWaitType(type) { changeWaitType(type) {
this.wait_type = type; this.status = type;
//
this.getCoinsList()
},
changeWaitType(type) {
this.status = type;
this.page = 1;
this.bedWaitList = [];
// //
this.getCoinsList() this.getCoinsList()
}, },
async scanQrcode() { async scanQrcode() {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
uni.scanCode({ uni.scanCode({
success: (res) => { success: (res) => {
console.log(res,'====---'); this.getScanQrcode(res.result)
let url = res.path;
// if(res.path) {
// }
// const res = await this.$request({
// url: '/get_scan_code_detail',
// method: 'POST',
// data: {
// url
// }
// });
// if(res.code == 0){
// // this.scanCodeDetail = res.data
// // this.$refs.coinsPopup.openPop()
// }
}, },
complete(res) { complete(res) {
if (res.errMsg === 'scanCode:ok') { if (res.errMsg === 'scanCode:ok') {
console.log('扫码成功:', res.result); console.log('扫码成功11:', res.result,this);
} else if (res.errMsg === 'scanCode:fail cancel') { } else if (res.errMsg === 'scanCode:fail cancel') {
console.log('用户取消扫码'); console.log('用户取消扫码');
} else { } else {
@ -264,34 +231,56 @@ export default {
}) })
// #endif // #endif
}, },
getScanQrcode(result){
this.$http.req('/api/get_scan_code_detail', {
url:result
}, 'POST').then(data => {
console.log(data,'data===data');
this.scanCodeDetail = data;
this.$set(this,'scanCodeDetail',data)
setTimeout(()=>{
console.log(this.scanCodeDetail,'222');
this.$refs.coinsPopup.openPop();
},500)
}).catch(res=>{
});
},
async onConfirm() { async onConfirm() {
// //
let url = '/'// let url = '/api/operate'//
let operate = ''
// url // url
let status = this.scanCodeDetail.ancient_coin_status;
// if(status ==0 || status == 2){
const res = await this.$request({ operate = '1'
url: '/get_scan_code_detail', }else{
method: 'POST', operate = '2'
data: {
url
} }
}); //
this.$http.req(url, {
if(res.code == 0){ scan_code_detail:JSON.stringify(this.scanCodeDetail),
operate: operate
}, 'POST').then(data => {
// - // -
if(this.scanCodeDetail.type == '为入库'){ //
if (this.wait_type != '0') this.wait_type = '0' if (status == 0 || status == '2') {
if (this.status != '1') this.status = '1'
} else { } else {
if (this.wait_type != '1') this.wait_type = '1' if (this.status != '2') this.status = '2'
} }
this.bedWaitList = [];
this.page = 1;
// //
this.getCoinsList() this.getCoinsList()
// this.$refs.coinsPopup.closePop() this.$refs.coinsPopup.closePop()
} }).catch(res=>{
this.loading = false;
});
}, },
cancelClick(){ onCancel() {
this.$refs.coinsPopup.closePop() this.$refs.coinsPopup.closePop()
}, },
} }
@ -301,7 +290,8 @@ export default {
.home-wrap { .home-wrap {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100vh;
.amountWrap { .amountWrap {
gap: 16rpx; gap: 16rpx;
padding: 36rpx 24rpx; padding: 36rpx 24rpx;
@ -394,7 +384,8 @@ export default {
} }
} }
.remain,.outbound { .remain,
.outbound {
font-weight: 500; font-weight: 500;
color: #00A2E2; color: #00A2E2;
line-height: 56rpx; line-height: 56rpx;
@ -406,11 +397,12 @@ export default {
} }
.patient-type-tab1 { .patient-type-tab1 {
height: auto; height: 0;
width: 100%; width: 100%;
background: white; background: white;
overflow-y: auto; // overflow-y: auto;
flex: 1; flex: 1;
.bed-wait-container { .bed-wait-container {
padding: 0rpx 42rpx; padding: 0rpx 42rpx;
background: white; background: white;
@ -486,14 +478,25 @@ export default {
} }
} }
} }
.list-wrap { .list-wrap {
padding: 20rpx 18rpx; padding: 20rpx 18rpx;
} }
.qrcode_wrap { .qrcode_wrap {
position: relative; // position: relative;
// background: #fff;
// height: 166rpx;
// box-shadow: 0px -2rpx 116rpx 0px rgba(181, 181, 181, 0.26);
background: #fff; background: #fff;
height: 166rpx; height: 166rpx;
position: fixed;
width: 100%;
left: 0;
bottom: 0;
box-shadow: 0px -2rpx 116rpx 0px rgba(181, 181, 181, 0.26); box-shadow: 0px -2rpx 116rpx 0px rgba(181, 181, 181, 0.26);
img { img {
width: 122rpx; width: 122rpx;
height: 142rpx; height: 142rpx;
@ -503,6 +506,7 @@ export default {
transform: translateX(-50%); transform: translateX(-50%);
} }
} }
.content { .content {
margin-bottom: 145rpx; margin-bottom: 145rpx;
} }
@ -532,73 +536,16 @@ export default {
border-radius: 12rpx; border-radius: 12rpx;
} }
.page-padding{
} padding-bottom: constant(safe-area-inset-bottom);
</style> --> padding-bottom: env(safe-area-inset-bottom);
width: 100%;
<template> height: 206rpx;
<view>
<button @click="handleLogin">登录</button>
<button v-if="hasLogin" @click="handleAuth">授权获取用户信息</button>
</view>
</template>
<script>
export default {
data() {
return {
hasLogin: false,
code: '',
openid: ''
};
},
onLoad(){
this.getCoinsList()
},
methods: {
getCoinsList(){
//
// const res = await this.$request({
// url: '/getlist',
// method: 'POST',
// data: {
// type:this.wait_type
// }
// });
// if (res.code !== 0) {
// this.$pop.modelShow(res.msg)
// return;
// }
this.$http.req('api/getlist',{status:'1',page:1,pagesize:10}, 'POST').then(data=>{
console.log(data,'====');
});
// this.bedWaitList = res.data;
},
// 1. code openid
async handleLogin() {
try {
const res = await wx.login({ provider: 'weixin' });
console.log(res,'====----');
this.code = res.code;
// code openid
const { data } = await uni.request({
url: 'http://coin.checkcopy.com/api/login',
method: 'POST',
data: { code: this.code }
});
if (data.success) {
this.openid = data.openid;
this.hasLogin = true; //
uni.showToast({ title: '登录成功', icon: 'none' });
} }
} catch (err) { .loading-text, .no-more-text {
console.error('登录失败:', err); text-align: center;
padding: 20rpx;
color: #999;
} }
},
} }
}; </style>
</script>

BIN
static/images/qrcode_get.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Loading…
Cancel
Save