完成积分锁客模块
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
<setting ref="settingRef" name="setting" key="setting" v-if="tabsActive == 0" />
|
||||
<productPage ref="productPageRef" name="productPage" key="productPage" v-if="tabsActive == 1" />
|
||||
<record ref="recordRef" name="record" key="record" :top="headHeight + 54" v-if="tabsActive == 2" />
|
||||
<userRecord ref="userRecordRef" name="userRecord" key="userRecord" v-if="tabsActive == 3" />
|
||||
</view>
|
||||
<view class="tab-wrap" :style="{ top: `${headHeight}px` }">
|
||||
<view class="tab-list">
|
||||
@@ -22,6 +23,7 @@
|
||||
</view>
|
||||
<my-footer-btn type="horizontal" showCancel @confirm="settingRef.submitHandle()" @cancel="backHandle" v-if="tabsActive == 0"></my-footer-btn>
|
||||
<my-footer-btn confirmText="添加商品" type="horizontal" @confirm="toAddProduct" v-if="tabsActive == 1"></my-footer-btn>
|
||||
<my-footer-btn confirmText="扫码核销" v-if="tabsActive == 2" @confirm="scanHandle"></my-footer-btn>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -31,13 +33,15 @@ import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app';
|
||||
import setting from './components/setting.vue';
|
||||
import productPage from './components/productPage.vue';
|
||||
import record from './components/record.vue';
|
||||
import userRecord from './components/userRecord.vue';
|
||||
|
||||
const settingRef = ref(null);
|
||||
const productPageRef = ref(null);
|
||||
const recordRef = ref(null);
|
||||
const userRecordRef = ref(null);
|
||||
|
||||
const headHeight = ref(0);
|
||||
const tabsActive = ref(2);
|
||||
const tabsActive = ref(3);
|
||||
const tabs = ref([
|
||||
{
|
||||
value: 1,
|
||||
@@ -71,6 +75,16 @@ function toAddProduct() {
|
||||
});
|
||||
}
|
||||
|
||||
// 扫码核销
|
||||
function scanHandle() {
|
||||
uni.scanCode({
|
||||
success: (res) => {
|
||||
console.log('扫码核销===', res.result);
|
||||
recordRef.value.checkoutAjax(res.result);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onReachBottom(() => {
|
||||
switch (tabsActive.value) {
|
||||
case 0:
|
||||
@@ -82,6 +96,7 @@ onReachBottom(() => {
|
||||
recordRef.value.reachBottom();
|
||||
break;
|
||||
case 3:
|
||||
userRecordRef.value.reachBottom();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user