|
@@ -2,8 +2,8 @@
|
|
<dialog-base ref="baseDialog" title="提示">
|
|
<dialog-base ref="baseDialog" title="提示">
|
|
<view class="msg uni-row">{{message}}</view>
|
|
<view class="msg uni-row">{{message}}</view>
|
|
<view class="btn-container uni-row">
|
|
<view class="btn-container uni-row">
|
|
- <button type="primary" ref="confirm" class="btn" @click="handleChoice()">确认</button>
|
|
|
|
- <button type="primary" ref="cancel" class="btn" @click="handleChoice()">取消</button>
|
|
|
|
|
|
+ <button type="primary" class="btn" @click="handleConfirm">确认</button>
|
|
|
|
+ <button type="primary" class="btn" @click="handleCancel">取消</button>
|
|
</view>
|
|
</view>
|
|
</dialog-base>
|
|
</dialog-base>
|
|
</template>
|
|
</template>
|
|
@@ -13,29 +13,38 @@
|
|
ref,
|
|
ref,
|
|
getCurrentInstance
|
|
getCurrentInstance
|
|
} from 'vue'
|
|
} from 'vue'
|
|
|
|
+ import {
|
|
|
|
+ saveUserequipment
|
|
|
|
+ } from '@/api/business/userEquipment/userEquipment.js'
|
|
|
|
+ import { defineProps } from 'vue'
|
|
const baseDialog = ref(null)
|
|
const baseDialog = ref(null)
|
|
const message = ref('')
|
|
const message = ref('')
|
|
- const confirm = ref(null)
|
|
|
|
- const cancel = ref(null)
|
|
|
|
-
|
|
|
|
|
|
+ const reqParam = ref({})
|
|
|
|
+ const fatMethod = defineProps({
|
|
|
|
+ init: Function
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
|
|
- async function open(data) {
|
|
|
|
- message.value = data;
|
|
|
|
|
|
+ function open(msg,data) {
|
|
|
|
+ message.value = msg;
|
|
|
|
+ reqParam.value = data;
|
|
baseDialog.value.open();
|
|
baseDialog.value.open();
|
|
- const result = await handleChoice();
|
|
|
|
- return result;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- async function handleChoice() {
|
|
|
|
- // let flag = null;
|
|
|
|
- // confirm.value.addEventListener('click', function() {
|
|
|
|
- // flag = 1;
|
|
|
|
- // })
|
|
|
|
- // cancel.value.addEventListener('click',function(){
|
|
|
|
- // flag = 0;
|
|
|
|
- // })
|
|
|
|
- close()
|
|
|
|
- return 1;
|
|
|
|
|
|
+ function handleConfirm() {
|
|
|
|
+ saveUserequipment(reqParam.value).then(res => {
|
|
|
|
+ if(res.code === 200){
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: "success",
|
|
|
|
+ title: "设备绑定成功"
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ close();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function handleCancel() {
|
|
|
|
+ close();
|
|
}
|
|
}
|
|
|
|
|
|
function close() {
|
|
function close() {
|