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. 609
      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();
}
// const NODE_ENV = 'development';
const NODE_ENV = 'production';
const NODE_ENV = 'development';
// const NODE_ENV = 'production';
if(Vue.prototype.provider == Vue.prototype.provider_weixin){
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 {
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{
if(NODE_ENV == 'development'){
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';
}
const CODE_SUCCESS = 0;
const CODE_SUCCESS = 200;
const CODE_ERROR = 40001;
const CODE_LOGIN_EXIPRE = 40002;
@ -222,7 +225,7 @@ function req(url, data={}, method = 'POST', header={}) {
var isNeedLogin = !noNeedLoginFunc.includes(url);
var headerObj = {'content-type': 'application/x-www-form-urlencoded'};
var token = getToken();
var token = uni.getStorageSync("u_token");
if(token) headerObj.AUTH = token
return new Promise((resolve, reject) => {
@ -260,8 +263,7 @@ function req(url, data={}, method = 'POST', header={}) {
});
return;
}
if(data.xcx_scource == Vue.prototype.USER_SOURCE_WX_XCX && !data.repeat && rdata.code==CODE_LOGIN_EXIPRE && url != '/api/common/xcx_login'){
if(data.xcx_scource == Vue.prototype.USER_SOURCE_WX_XCX && !data.repeat && rdata.code==CODE_LOGIN_EXIPRE && url != '/api/login'){
removeLogin();
xcx_login(url, data, method).then(data=>{
return resolve(data);
@ -328,12 +330,15 @@ function xcx_login(url, eqdata={}, method = 'POST') {
pdata.code = res.code;
var doctor_id = uni.getStorageSync('doctor_id');
pdata.state = 'user-'+doctor_id;
req('/api/common/xcx_login', pdata).then(data=>{
debugger
req('/api/login', pdata).then(data=>{
var udata = data
console.log(data,'===2222');
if(udata && udata.jwttoken) {
setToken(udata.jwttoken)
setUinfo(JSON.stringify(udata))
uni.setStorageSync("u_token", udata.jwttoken)
// setToken(udata.jwttoken)
// setUinfo(JSON.stringify(udata))
}
pdata.repeat = 1;

3
pages.json

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

59
pages/coinsDetail/index.vue

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

609
pages/home/index.vue

@ -1,297 +1,286 @@
<!-- <template>
<view class="home-wrap">
<view class="amountWrap flex">
<view class="amountLeft flex">
<view class="amountName">库存件数</view>
<view class="remain">190009</view>
</view>
<view class="amountRight flex">
<view class="amountName">出库件数</view>
<view class="outbound">1009</view>
</view>
</view>
<view class="patientTab">
<view :class="'notActive ft32' + (wait_type == '0' ? ' active PfScMedium' : '')"
@click="changeWaitType('0')">库存列表</view>
<view :class="'notActive ft32' + (wait_type == '1' ? ' active PfScMedium' : '')"
@click="changeWaitType('1')">
出库列表
</view>
</view>
<view class="patient-type-tab1">
<view class="bed-wait-container">
<view class="bed-wait-list">
<view class="bed-wait-item" v-for="(item, index) in bedWaitList" :key="index"
@click="lookDetail(item)">
<view class="bed-wait-info">
<view class="bed-wait-name PfScMedium">{{ item.name }}</view>
<view class="bed-sex">{{ item.year }}</view>
<view :class="'bed-desc'">
{{ item.phone }}
</view>
<template>
<!-- <view style="height:100vh">
<Mescroll @resultEvent="getList" ref="scroll" rqurl="/api/getlist">
<template v-slot:list> -->
<view class="home-wrap">
<view class="amountWrap flex">
<view class="amountLeft flex">
<view class="amountName">库存件数</view>
<view class="remain">{{ storage_count || 0 }}</view>
</view>
<view class="bed-wait-time flex-between">
<view class="bed-visit-time">{{ item.time }}</view>
<view class="bed-checkin-time">{{ item.address }}</view>
<view class="amountRight flex">
<view class="amountName">出库件数</view>
<view class="outbound">{{ delivery_count || 0 }}</view>
</view>
</view>
<view class="patientTab">
<view :class="'notActive ft32' + (status == '1' ? ' active PfScMedium' : '')"
@click="changeWaitType('1')">
库存列表</view>
<view :class="'notActive ft32' + (status == '2' ? ' active PfScMedium' : '')"
@click="changeWaitType('2')">
出库列表
</view>
</view>
</view>
</view>
<!-- <view class="patient-type-tab1"> -->
<scroll-view class="patient-type-tab1" @scrolltolower="onScroll" scroll-y>
<view class="bed-wait-container">
<view class="bed-wait-list">
<view class="bed-wait-item" v-for="(item, index) in bedWaitList" :key="index"
@click="lookDetail(item)">
<view class="bed-wait-info">
<view class="bed-wait-name PfScMedium">{{ item.coin_name }}</view>
<view class="bed-sex">{{ item.year }}</view>
<view class="page-padding" v-show="bedWaitList && bedWaitList.length && bedWaitList.length > 0"></view>
<view :class="'bed-desc'">
{{ item.rating_code }}
</view>
</view>
</view>
<view class="qrcode_wrap">
<img :src="cssUrl + 'qrcode_get.png'" alt="" @click="scanQrcode">
</view>
</view>
<view class="bed-wait-time flex-between">
<view class="bed-visit-time">{{ item.operate_time }}</view>
<view class="bed-checkin-time">{{ item.rating_department }}</view>
</view>
</view>
</view>
</view>
<view v-if="loading" class="loading-text">加载中...</view>
<view v-if="noMore" class="no-more-text">没有更多数据了</view>
<view class="page-padding" v-show="bedWaitList && bedWaitList.length && bedWaitList.length > 0">
</view>
</scroll-view>
<!-- </view> -->
<view class="qrcode_wrap">
<img :src="cssUrl + 'qrcode_get.png'" alt="" @click="scanQrcode">
</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>
</PopUpCommon>
</view>
<!-- </template>
</Mescroll>
</view> -->
</template>
<script>
// import PopUpCommon from '@/components/common/popUpCommon.vue';
// import PageBottomBtn from '@/components/new/pageBottomBtn.vue'
import ListBox from '@/components/listBox.vue';
import PopUpCommon from '@/components/common/popUpCommon.vue';
import CoinsDetail from '../coinsDetail';
import PageBottomBtn from '@/components/pageBottomBtn.vue'
import Mescroll from '@/components/common/mescroll.vue'
export default {
options: { styleIsolation: "shared" },
components: {
// PopUpCommon,
// PageBottomBtn,
PopUpCommon,
PageBottomBtn,
Mescroll,
ListBox,
CoinsDetail
},
data() {
return {
cssUrl: this.cssUrl,
wait_type: '0',
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:{
'1':'扫码入库',
'2':'扫码出库',
'3':'出库信息',
status: '1',
bedWaitList: [],
titleType: {
0: '扫码入库',
'1': '扫码出库',
'2': '出库信息',
},
btnText: {
0: '入库',
'1': '出库',
'2': '再次入库',
},
btnText:{
'1':'入库',
'2':'出库',
detailItem: {
name: '北京公博二部',
num: '1310684212',
count: 'AU 58',
size: '24.0*1.1mm,3.5g',
operate: '泅渡'
},
coinsType:'1',//
detailItem:{
name:'北京公博二部',
num:'1310684212',
count:'AU 58',
size:'24.0*1.1mm,3.5g',
operate:'泅渡'
code: '',
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"
},
code:'',
state:''
loading:false,
noMore:false,
page:1,
pagesize:7
}
},
onLoad(option) {
// var token = uni.getStorageSync("u_token");
// if(option.code && option.state) {
// this.code = option.code
// this.state = option.state
// }
//
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: {
getCoinsList(){
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() {
this.loading = true;
//
// 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.$http.req('/api/getlist', { status: this.status, page: this.page, pagesize: this.pagesize}, 'POST').then(data => {
uni.stopPullDownRefresh();
this.loading = false;
if ( data.list.length === 0 || data.length == 0 ) {
this.noMore = true;
uni.showToast({ title: '没有更多数据了', icon: 'none' });
return;
}
//
if (this.page === 1) {
this.bedWaitList = data.list;
} else {
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){
let url = `/pages/coinsDetail/index?id=${item.id}`
this.$nav.navToPath(url)
lookDetail(item) {
uni.setStorageSync('detail',JSON.stringify(item))
// let url = `/pages/coinsDetail/index`
let url = `/pages/coinsDetail/index?id=${item.rating_code}`
this.$nav.navToPath(url)
},
changeWaitType(type){
this.wait_type = type;
changeWaitType(type) {
this.status = type;
//
this.getCoinsList()
},
changeWaitType(type) {
this.status = type;
this.page = 1;
this.bedWaitList = [];
//
this.getCoinsList()
},
async scanQrcode() {
// #ifdef MP-WEIXIN
uni.scanCode({
success: (res) => {
console.log(res,'====---');
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) {
if (res.errMsg === 'scanCode:ok') {
console.log('扫码成功:', res.result);
} else if (res.errMsg === 'scanCode:fail cancel') {
console.log('用户取消扫码');
} else {
uni.showToast({
title: '扫码失败'+JSON.stringify(res.errMsg),
icon: 'none'
})
}
}
})
// #endif
},
async onConfirm(){
// #ifdef MP-WEIXIN
uni.scanCode({
success: (res) => {
this.getScanQrcode(res.result)
},
complete(res) {
if (res.errMsg === 'scanCode:ok') {
console.log('扫码成功11:', res.result,this);
} else if (res.errMsg === 'scanCode:fail cancel') {
console.log('用户取消扫码');
} else {
uni.showToast({
title: '扫码失败' + JSON.stringify(res.errMsg),
icon: 'none'
})
}
}
})
// #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() {
//
let url = '/'//
let url = '/api/operate'//
let operate = ''
// url
let status = this.scanCodeDetail.ancient_coin_status;
if(status ==0 || status == 2){
operate = '1'
}else{
operate = '2'
}
//
const res = await this.$request({
url: '/get_scan_code_detail',
method: 'POST',
data: {
url
}
this.$http.req(url, {
scan_code_detail:JSON.stringify(this.scanCodeDetail),
operate: operate
}, 'POST').then(data => {
// -
//
if (status == 0 || status == '2') {
if (this.status != '1') this.status = '1'
} else {
if (this.status != '2') this.status = '2'
}
this.bedWaitList = [];
this.page = 1;
//
this.getCoinsList()
this.$refs.coinsPopup.closePop()
}).catch(res=>{
this.loading = false;
});
if(res.code == 0){
// -
if(this.scanCodeDetail.type == '为入库'){
if (this.wait_type != '0') this.wait_type = '0'
}else{
if (this.wait_type != '1') this.wait_type = '1'
}
//
this.getCoinsList()
// this.$refs.coinsPopup.closePop()
}
},
cancelClick(){
onCancel() {
this.$refs.coinsPopup.closePop()
},
}
@ -301,7 +290,8 @@ export default {
.home-wrap {
display: flex;
flex-direction: column;
height: 100%;
height: 100vh;
.amountWrap {
gap: 16rpx;
padding: 36rpx 24rpx;
@ -394,7 +384,8 @@ export default {
}
}
.remain,.outbound {
.remain,
.outbound {
font-weight: 500;
color: #00A2E2;
line-height: 56rpx;
@ -406,11 +397,12 @@ export default {
}
.patient-type-tab1 {
height: auto;
height: 0;
width: 100%;
background: white;
overflow-y: auto;
// overflow-y: auto;
flex: 1;
.bed-wait-container {
padding: 0rpx 42rpx;
background: white;
@ -486,15 +478,26 @@ export default {
}
}
}
.list-wrap{
.list-wrap {
padding: 20rpx 18rpx;
}
.qrcode_wrap{
position: relative;
.qrcode_wrap {
// position: relative;
// background: #fff;
// height: 166rpx;
// box-shadow: 0px -2rpx 116rpx 0px rgba(181, 181, 181, 0.26);
background: #fff;
height: 166rpx;
position: fixed;
width: 100%;
left: 0;
bottom: 0;
box-shadow: 0px -2rpx 116rpx 0px rgba(181, 181, 181, 0.26);
img{
img {
width: 122rpx;
height: 142rpx;
position: absolute;
@ -503,22 +506,23 @@ export default {
transform: translateX(-50%);
}
}
.content{
.content {
margin-bottom: 145rpx;
}
.pop-title{
height: 40rpx;
text-align: center;
margin:42rpx 0 22rpx 0;
.pop-title {
height: 40rpx;
text-align: center;
margin: 42rpx 0 22rpx 0;
font-size: 36rpx;
font-weight: 500;
line-height: 50rpx;
text-align: center;
letter-spacing: 2rpx;
color: #000000;
// background: #F6F6F8;
}
// background: #F6F6F8;
}
.cancle-button {
font-weight: 500;
@ -532,73 +536,16 @@ export default {
border-radius: 12rpx;
}
}
</style> -->
<template>
<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) {
console.error('登录失败:', err);
}
},
.page-padding{
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
width: 100%;
height: 206rpx;
}
};
</script>
.loading-text, .no-more-text {
text-align: center;
padding: 20rpx;
color: #999;
}
}
</style>

BIN
static/images/qrcode_get.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Loading…
Cancel
Save