|
@@ -1,7 +1,7 @@
|
|
<script setup>
|
|
<script setup>
|
|
import { ref, onMounted, onUnmounted, computed } from "vue";
|
|
import { ref, onMounted, onUnmounted, computed } from "vue";
|
|
import { useRoute } from "vue-router";
|
|
import { useRoute } from "vue-router";
|
|
-import { Sticky, Icon, ImagePreview,Popup } from "vant";
|
|
|
|
|
|
+import { Sticky, Icon, ImagePreview,Popup,Toast } from "vant";
|
|
import moment from "moment";
|
|
import moment from "moment";
|
|
import 'moment/dist/locale/zh-cn';
|
|
import 'moment/dist/locale/zh-cn';
|
|
moment.locale('zh-cn');
|
|
moment.locale('zh-cn');
|
|
@@ -32,13 +32,12 @@ const getClassify = async () => {
|
|
_.isShow = _.list ? _.list.some(sub_item => sub_item.pirce_driven_state) : false
|
|
_.isShow = _.list ? _.list.some(sub_item => sub_item.pirce_driven_state) : false
|
|
})
|
|
})
|
|
varietiesList.value = permission_list.filter(_ => _.isShow);
|
|
varietiesList.value = permission_list.filter(_ => _.isShow);
|
|
-
|
|
|
|
// 分享进入的默认品种
|
|
// 分享进入的默认品种
|
|
if (route.query.default_classify_first) {
|
|
if (route.query.default_classify_first) {
|
|
let index = varietiesList.value.findIndex(
|
|
let index = varietiesList.value.findIndex(
|
|
(_) => _.id === Number(route.query.default_classify_first)
|
|
(_) => _.id === Number(route.query.default_classify_first)
|
|
);
|
|
);
|
|
- changeClassify(varietiesList.value[index],'share');
|
|
|
|
|
|
+ index === -1 ? errorLinkHandle() : changeClassify(varietiesList.value[index],'share');
|
|
} else {
|
|
} else {
|
|
changeClassify(varietiesList.value[0]);
|
|
changeClassify(varietiesList.value[0]);
|
|
}
|
|
}
|
|
@@ -58,7 +57,7 @@ const changeClassify = (item,type='') => {
|
|
let index = classifyList.value.findIndex(
|
|
let index = classifyList.value.findIndex(
|
|
(_) => _.chart_permission_id === Number(route.query.default_classify_sub)
|
|
(_) => _.chart_permission_id === Number(route.query.default_classify_sub)
|
|
);
|
|
);
|
|
- changeSubClassify(classifyList.value[index]);
|
|
|
|
|
|
+ index === -1 ? errorLinkHandle() : changeSubClassify(classifyList.value[index]);
|
|
} else {
|
|
} else {
|
|
changeSubClassify(classifyList.value[0]);
|
|
changeSubClassify(classifyList.value[0]);
|
|
}
|
|
}
|
|
@@ -72,6 +71,16 @@ const changeSubClassify = ({ chart_permission_id, chart_permission_name }) => {
|
|
getDetail();
|
|
getDetail();
|
|
|
|
|
|
};
|
|
};
|
|
|
|
+/* 过期link处理 */
|
|
|
|
+const errorLinkHandle = () => {
|
|
|
|
+ Toast('该价格驱动不存在')
|
|
|
|
+
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ wx.miniProgram.redirectTo({
|
|
|
|
+ url:"/pages/report/report"
|
|
|
|
+ });
|
|
|
|
+ },1000)
|
|
|
|
+}
|
|
|
|
|
|
//详情信息
|
|
//详情信息
|
|
const showData = ref(false);
|
|
const showData = ref(false);
|