Browse Source

fix: 主流程字段修改+个人信息展示fix

laiqi 1 year ago
parent
commit
0cea263651

+ 2 - 3
.cursor/rules/uni.mdc

@@ -1,10 +1,9 @@
 ---
-description: 
+description: project framework and ui
 globs: 
+alwaysApply: false
 ---
-
 # Your rule content
-
 - This project is based on Vue3 + Vite5 + Pnpm + TypeScript;
 - This project uses UnoCSS + UnoCSS Icons;
 - This project is based on unibest(https://www.unibest.tech/base/2-start);

+ 9 - 8
env/.env

@@ -7,18 +7,19 @@ VITE_WX_APPID = 'wxd3ca52d7f454048d'
 # h5部署网站的base,配置到 manifest.config.ts 里的 h5.router.base
 VITE_APP_PUBLIC_BASE=/unibest/
 
-VITE_SERVER_BASEURL = 'http://211.149.199.65:5012'
-VITE_UPLOAD_BASEURL = 'http://211.149.199.65:5012'
+# VITE_SERVER_BASEURL = 'http://211.149.199.65:5012'
+VITE_SERVER_BASEURL = 'https://dzapi.kdboss.cn'
+VITE_UPLOAD_BASEURL = 'https://dzapi.kdboss.cn'
 
 # 有些同学可能需要在微信小程序里面根据 develop、trial、release 分别设置上传地址,参考代码如下。
 # 下面的变量如果没有设置,会默认使用 VITE_SERVER_BASEURL or VITE_UPLOAD_BASEURL
-VITE_SERVER_BASEURL__WEIXIN_DEVELOP = 'http://211.149.199.65:5012'
-VITE_SERVER_BASEURL__WEIXIN_TRIAL = 'http://211.149.199.65:5012'
-VITE_SERVER_BASEURL__WEIXIN_RELEASE = 'http://211.149.199.65:5012'
+VITE_SERVER_BASEURL__WEIXIN_DEVELOP = 'https://dzapi.kdboss.cn'
+VITE_SERVER_BASEURL__WEIXIN_TRIAL = 'https://dzapi.kdboss.cn'
+VITE_SERVER_BASEURL__WEIXIN_RELEASE = 'https://dzapi.kdboss.cn'
 
-VITE_UPLOAD_BASEURL__WEIXIN_DEVELOP = 'http://211.149.199.65:5012'
-VITE_UPLOAD_BASEURL__WEIXIN_TRIAL = 'http://211.149.199.65:5012'
-VITE_UPLOAD_BASEURL__WEIXIN_RELEASE = 'http://211.149.199.65:5012'
+VITE_UPLOAD_BASEURL__WEIXIN_DEVELOP = 'https://dzapi.kdboss.cn'
+VITE_UPLOAD_BASEURL__WEIXIN_TRIAL = 'https://dzapi.kdboss.cn'
+VITE_UPLOAD_BASEURL__WEIXIN_RELEASE = 'https://dzapi.kdboss.cn'
 
 # h5是否需要配置代理
 VITE_APP_PROXY=false

+ 1 - 1
src/pages-sub/user/index.vue

@@ -316,7 +316,7 @@ const getUserDetail = async () => {
     // userszcd: '',
     // userscz: '',
     // usersbz: '',
-    model.usersname = Data.usersname
+    model.usersname = Data.usersname || '微信用户'
     model.userstype = Data.userstype || '个人'
     model.usersidcardnumber = Data.usersidcardnumber
     model.usersbankname = Data.usersbankname

+ 9 - 3
src/pages/form/formStep3.vue

@@ -124,7 +124,9 @@
 
     <!-- loading -->
     <wd-overlay :show="overlayShow">
-      <wd-loading />
+      <view class="wrapper w-full h-full flex items-center justify-center">
+        <wd-loading />
+      </view>
     </wd-overlay>
   </view>
 </template>
@@ -143,7 +145,7 @@ const couponStore = useCouponStore()
 const productStore = useProductStore()
 const orderStore = useOrderStore()
 const message = useMessage()
-const usersid = ref('') // 销售网点用户id
+const usersid = ref('') // 销售网点用户id(渠道id)
 const productsid = ref('') // 产品id
 const productInfo = ref<any>(null) // 产品详情
 const overlayShow = ref(false) // 加载状态
@@ -198,6 +200,7 @@ function handleSubmit() {
           ordersproductid: productsid.value,
           orderscouponid: currentCoupon2id.value,
           ordersproductsn: model.ordersproductsn,
+          ordersuserid1: usersid.value, // 渠道id  魏哥:微信下单增加参数ordersuserid1对应渠道id,后端渠道看自己的订单数据相比管理员只需要另外新增菜单权限配置,额外固定配置参数ordersuserid1.value=session:workeruserid,界面都可以先套用,然后给渠道归类一个角色。
         })
         message
           .alert({
@@ -226,7 +229,10 @@ function handleSubmit() {
 async function getProductDetail() {
   if (!productsid.value) return
   overlayShow.value = true
-  productInfo.value = await productStore.getProductDetail(productsid.value)
+  productInfo.value = await productStore.getProductDetail({
+    productsid: productsid.value,
+    merchantid: usersid.value,
+  })
   overlayShow.value = false
 }
 

+ 2 - 1
src/pages/mine/index.vue

@@ -26,7 +26,7 @@
         </view> -->
         <view class="ml-4 text-white">
           <view class="text-xl font-bold">
-            {{ isLogin ? userDetail.usersname : '未登录' }}
+            {{ isLogin ? userDetail.usersname || '微信用户' : '未登录' }}
           </view>
           <view class="text-sm mt-1 opacity-90" v-if="!isLogin">当前游客身份</view>
         </view>
@@ -108,6 +108,7 @@ const isLogin = computed(() => appStore.isLogined)
 
 onMounted(() => {
   userDetail.value = userStore.userDetail
+  console.log(userDetail.value, 'userDetail')
 })
 
 // 页面跳转

+ 3 - 1
src/pages/order/index.vue

@@ -49,7 +49,9 @@
 
       <!-- loading -->
       <wd-overlay :show="overlayShow">
-        <wd-loading />
+        <view class="wrapper w-full h-full flex items-center justify-center">
+          <wd-loading />
+        </view>
       </wd-overlay>
 
       <!-- 回到首页 -->

+ 11 - 3
src/service/product/index.ts

@@ -10,16 +10,24 @@ export const getProductListApi = (
 ) => {
   return http.get<ListResponseType<ProductUserScqyType>>('/api/query/list?pagevalue=59', {
     ...page,
-    ...parseQueryValues(params),
+    // ...parseQueryValues(params),
+    'productsmerchantid.find': params.productsmerchantid,
   })
 }
 
 /** 获取商品详情 */
-export const getProductDetailApi = (id: string) => {
+export const getProductDetailApi = ({
+  productsid,
+  merchantid,
+}: {
+  productsid: string
+  merchantid: string
+}) => {
   return http.get<ProductUserScqyType>(
     '/api/query/view?pagevalue=60',
     {
-      ...parseQueryValues({ productsid: id }),
+      ...parseQueryValues({ productsid }),
+      'usersid.value': merchantid,
     },
     {
       formatData: true,

+ 1 - 0
src/store/order.ts

@@ -33,6 +33,7 @@ export const useOrderStore = defineStore(
       ordersproductid: string
       orderscouponid: string
       ordersproductsn: string
+      ordersuserid1: string
     }) => {
       const { data: order, loading } = useRequest(() => submitOrderApi(params), {
         immediate: true,

+ 7 - 4
src/store/product.ts

@@ -19,10 +19,13 @@ export const useProductStore = defineStore(
     }
 
     // 获取产品详情
-    const getProductDetail = async (productsid: string) => {
-      const { data: productDetail, loading } = useRequest(() => getProductDetailApi(productsid), {
-        immediate: true,
-      })
+    const getProductDetail = async ({ productsid, merchantid }) => {
+      const { data: productDetail, loading } = useRequest(
+        () => getProductDetailApi({ productsid, merchantid }),
+        {
+          immediate: true,
+        },
+      )
 
       await until(loading).toBe(false)
       return productDetail.value