ソースを参照

feat(component): 商品下单步骤1

laiqi 1 年間 前
コミット
b0433cbf4d

+ 1 - 0
manifest.config.ts

@@ -115,6 +115,7 @@ export default defineManifestConfig({
       urlCheck: false,
     },
     usingComponents: true,
+    lazyCodeLoading: 'requiredComponents',
     // __usePrivacyCheck__: true,
   },
   'mp-alipay': {

+ 2 - 1
src/manifest.json

@@ -87,7 +87,8 @@
     "setting": {
       "urlCheck": false
     },
-    "usingComponents": true
+    "usingComponents": true,
+    "lazyCodeLoading": "requiredComponents"
   },
   "mp-alipay": {
     "usingComponents": true,

+ 31 - 2
src/pages.json

@@ -47,10 +47,31 @@
       }
     },
     {
-      "path": "pages/form/form",
+      "path": "pages/form/formStep1",
       "type": "page",
       "style": {
-        "navigationBarTitleText": "优惠劵申请"
+        "navigationBarTitleText": "选择销售网点"
+      }
+    },
+    {
+      "path": "pages/form/formStep2",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "农机选择"
+      }
+    },
+    {
+      "path": "pages/form/formStep3",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "农机详情"
+      }
+    },
+    {
+      "path": "pages/form/formStep4",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "填写sn号"
       }
     },
     {
@@ -59,6 +80,14 @@
       "style": {
         "navigationBarTitleText": "我的"
       }
+    },
+    {
+      "path": "pages/product/detail",
+      "type": "page",
+      "layout": "default",
+      "style": {
+        "navigationBarTitleText": "产品详情"
+      }
     }
   ],
   "subPackages": [

+ 0 - 198
src/pages/form/form.vue

@@ -1,198 +0,0 @@
-<route lang="json5">
-{
-  style: {
-    navigationBarTitleText: '优惠劵申请',
-  },
-}
-</route>
-
-<template>
-  <view class="bg-white min-h-screen px-4 py-4">
-    <view class="space-y-4">
-      <!-- 销售点选择 -->
-      <view class="form-item">
-        <text class="form-label">销售点</text>
-        <wd-select-picker
-          label=""
-          v-model="formData.location"
-          :columns="locationOptions"
-          @change="handleChange"
-        ></wd-select-picker>
-      </view>
-
-      <!-- 用户名称 -->
-      <view class="form-item">
-        <text class="form-label">用户名称</text>
-        <wd-input v-model="formData.name" placeholder="请输入用户名称" />
-      </view>
-
-      <!-- 用户类型 -->
-      <view class="form-item">
-        <text class="form-label">用户类型</text>
-        <wd-radio-group v-model="formData.type" shape="button">
-          <wd-radio value="personal">个人</wd-radio>
-          <wd-radio value="enterprise">企业</wd-radio>
-        </wd-radio-group>
-      </view>
-
-      <!-- 证件号码 -->
-      <view class="form-item">
-        <text class="form-label">{{ formData.type === 'personal' ? '身份证号' : '纳税号' }}</text>
-        <wd-input
-          v-model="formData.id_card_number"
-          :placeholder="`请输入${formData.type === 'personal' ? '身份证号' : '纳税号'}`"
-        />
-      </view>
-
-      <!-- 开户银行名 -->
-      <view class="form-item">
-        <text class="form-label">开户银行名</text>
-        <wd-input v-model="formData.bank_name" placeholder="请输入开户银行名" />
-      </view>
-
-      <!-- 开户银行账号 -->
-      <view class="form-item">
-        <text class="form-label">开户银行账号</text>
-        <wd-input v-model="formData.bank_number" type="number" placeholder="请输入开户银行账号" />
-      </view>
-
-      <!-- 用户手机号 -->
-      <view class="form-item">
-        <text class="form-label">用户手机号</text>
-        <wd-input v-model="formData.phone" type="number" placeholder="请输入用户手机号" />
-      </view>
-
-      <!-- 用户邮箱 -->
-      <view class="form-item">
-        <text class="form-label">用户邮箱</text>
-        <wd-input v-model="formData.email" type="email" placeholder="请输入用户邮箱" />
-      </view>
-
-      <!-- 用户地址 -->
-      <view class="form-item">
-        <text class="form-label">用户地址</text>
-        <wd-input v-model="formData.address" type="textarea" placeholder="请输入用户地址" />
-      </view>
-
-      <!-- 用户联系手机号 -->
-      <view class="form-item">
-        <text class="form-label">用户联系手机号</text>
-        <wd-input
-          v-model="formData.contact_phone"
-          type="number"
-          placeholder="请输入用户联系手机号"
-        />
-      </view>
-
-      <!-- 用户联系邮箱 -->
-      <view class="form-item">
-        <text class="form-label">用户联系邮箱</text>
-        <wd-input v-model="formData.contact_email" type="email" placeholder="请输入用户联系邮箱" />
-      </view>
-
-      <!-- 用户联系地址 -->
-      <view class="form-item">
-        <text class="form-label">用户联系地址</text>
-        <wd-input
-          v-model="formData.contact_address"
-          type="textarea"
-          placeholder="请输入用户联系地址"
-        />
-      </view>
-
-      <!-- 提交按钮 -->
-      <view class="mt-8 pb-8">
-        <wd-button type="success" block @tap="handleSubmit">提交申请</wd-button>
-      </view>
-    </view>
-  </view>
-</template>
-
-<script lang="ts" setup>
-import { ref } from 'vue'
-
-const formData = ref({
-  name: '',
-  type: 'personal',
-  nature: 'user',
-  superiorid: '',
-  id_card_number: '',
-  bank_name: '',
-  bank_number: '',
-  phone: '',
-  email: '',
-  address: '',
-  contact_phone: '',
-  contact_email: '',
-  contact_address: '',
-})
-
-// const locationOptions = ref([
-//   { label: '达川区农机服务站', value: '1' },
-//   { label: '达州市达区农机站', value: '2' },
-//   { label: '达州市宣汉县农机推广中心', value: '3' },
-// ])
-const locationOptions = ref<Record<string, any>>([
-  {
-    value: '101',
-    label: '达川区农机服务站',
-  },
-  {
-    value: '102',
-    label: '达州市达区农机站',
-  },
-  {
-    value: '103',
-    label: '达州市宣汉县农机推广中心',
-  },
-])
-
-// 提交表单
-function handleSubmit() {
-  // 表单验证
-  if (!formData.value.name) {
-    return uni.showToast({ title: '请输入用户名称', icon: 'none' })
-  }
-  if (!formData.value.id_card_number) {
-    return uni.showToast({
-      title: formData.value.type === 'personal' ? '请输入身份证号' : '请输入纳税号',
-      icon: 'none',
-    })
-  }
-  if (!formData.value.bank_name) {
-    return uni.showToast({ title: '请输入开户银行名', icon: 'none' })
-  }
-  if (!formData.value.bank_number) {
-    return uni.showToast({ title: '请输入开户银行账号', icon: 'none' })
-  }
-  if (!formData.value.phone) {
-    return uni.showToast({ title: '请输入用户手机号', icon: 'none' })
-  }
-  if (!formData.value.email) {
-    return uni.showToast({ title: '请输入用户邮箱', icon: 'none' })
-  }
-  if (!formData.value.address) {
-    return uni.showToast({ title: '请输入用户地址', icon: 'none' })
-  }
-
-  // TODO: 调用提交接口
-  uni.showToast({
-    title: '提交成功',
-    icon: 'success',
-  })
-
-  // 延迟返回上一页
-  setTimeout(() => {
-    uni.navigateBack()
-  }, 1500)
-}
-</script>
-
-<style lang="scss" scoped>
-.form-item {
-  @apply mb-6;
-  .form-label {
-    @apply block text-gray-700 mb-2 text-base;
-  }
-}
-</style>

+ 94 - 0
src/pages/form/formStep1.vue

@@ -0,0 +1,94 @@
+<route lang="json5">
+{
+  style: {
+    navigationBarTitleText: '选择销售网点',
+  },
+}
+</route>
+
+<template>
+  <!-- 总体流程:选网点,选择机器型号,输入SN号,下订单 -->
+  <view class="bg-white min-h-screen">
+    <view class="space-y-4">
+      <wd-sticky-box>
+        <!-- 销售点选择 -->
+        <view class="sticky-box-content w-100vw">
+          <wd-search
+            placeholder="请输入销售网点名称"
+            cancel-txt="搜索"
+            @blur="blur"
+            @search="search"
+            @clear="clear"
+            @change="change"
+          />
+        </view>
+      </wd-sticky-box>
+
+      <!-- 销售网点列表 -->
+      <view class="sticky-box-content w-100vw">
+        <wd-cell-group>
+          <wd-cell
+            v-for="item in sellUserListShow"
+            :key="item.usersid"
+            :title="item.usersname"
+            :label="item.usersaddress"
+            is-link
+            @click="handleClick(item)"
+          />
+        </wd-cell-group>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { useUserStore } from '@/store/user'
+import { useThrottleFn } from '@vueuse/core'
+
+const userStore = useUserStore()
+const sellUserListAll = ref([])
+const sellUserListShow = ref([])
+
+function handleClick(item: any) {
+  uni.navigateTo({
+    url: `/pages/form/formStep2?usersid=${item.usersid}`,
+  })
+}
+
+function blur(e: any) {
+  const filters = sellUserListAll.value.filter((item: any) => item.usersname.includes(e.value))
+  sellUserListShow.value = filters
+}
+
+function search(e: any) {
+  const filters = sellUserListAll.value.filter((item: any) => item.usersname.includes(e.value))
+  sellUserListShow.value = filters
+}
+
+function clear() {
+  sellUserListShow.value = sellUserListAll.value
+}
+
+const handleChange = useThrottleFn(({ value }) => {
+  const filters = sellUserListAll.value.filter((item: any) => item.usersname.includes(value))
+  sellUserListShow.value = filters
+}, 500) // 500ms 的节流时间
+
+function change(e: any) {
+  handleChange(e)
+}
+
+onShow(async () => {
+  sellUserListAll.value = await userStore.getSellUserList()
+  sellUserListShow.value = sellUserListAll.value
+})
+</script>
+
+<style lang="scss" scoped>
+.form-item {
+  @apply mb-6;
+  .form-label {
+    @apply block text-gray-700 mb-2 text-base;
+  }
+}
+</style>

+ 103 - 0
src/pages/form/formStep2.vue

@@ -0,0 +1,103 @@
+<route lang="json5">
+{
+  style: {
+    navigationBarTitleText: '农机选择',
+  },
+}
+</route>
+
+<template>
+  <!-- 选网点,选择机器型号,输入SN号,下订单 -->
+  <view class="bg-white min-h-screen">
+    <view class="space-y-4">
+      <wd-sticky-box>
+        <!-- 产品选择 -->
+        <view class="sticky-box-content w-100vw">
+          <wd-search
+            placeholder="请输入产品名称"
+            cancel-txt="搜索"
+            @blur="blur"
+            @search="search"
+            @clear="clear"
+            @change="change"
+          />
+        </view>
+      </wd-sticky-box>
+
+      <!-- 产品列表 -->
+      <view class="sticky-box-content w-100vw">
+        <wd-cell-group>
+          <wd-cell
+            v-for="item in productListShow"
+            :key="item.productsid"
+            :title="item.productsname"
+            is-link
+            @click="handleClick(item)"
+            custom-class="product-cell"
+          >
+            <template #label>
+              <p class="text-gray-500">分类:{{ item.productsfl1 }} - {{ item.productsfl2 }}</p>
+              <p class="text-gray-500">生产厂家:{{ item.productsscqyid || '未知' }}</p>
+            </template>
+          </wd-cell>
+        </wd-cell-group>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { useProductStore } from '@/store/product'
+import { useThrottleFn } from '@vueuse/core'
+
+const productStore = useProductStore()
+const productListAll = ref([])
+const productListShow = ref([])
+const usersid = ref('') // 销售网点id
+
+function blur(e: any) {
+  const filters = productListAll.value.filter((item: any) => item.productsname.includes(e.value))
+  productListShow.value = filters
+}
+
+function search(e: any) {
+  const filters = productListAll.value.filter((item: any) => item.productsname.includes(e.value))
+  productListShow.value = filters
+}
+
+function clear() {
+  productListShow.value = productListAll.value
+}
+
+const handleChange = useThrottleFn(({ value }) => {
+  const filters = productListAll.value.filter((item: any) => item.productsname.includes(value))
+  productListShow.value = filters
+}, 500) // 500ms 的节流时间
+
+function change(e: any) {
+  handleChange(e)
+}
+
+function handleClick(item: any) {
+  uni.navigateTo({
+    url: `/pages/form/formStep3?usersid=${usersid.value}&productsid=${item.productsid}`,
+  })
+}
+
+onLoad((query) => {
+  usersid.value = query.usersid
+  productStore.getProductList(query.usersid).then((res) => {
+    productListAll.value = res
+    productListShow.value = res
+  })
+})
+</script>
+
+<style lang="scss" scoped>
+::v-deep(.product-cell) {
+  .wd-cell__right {
+    flex: inherit !important;
+    width: 50px !important;
+  }
+}
+</style>

+ 46 - 0
src/pages/form/formStep3.vue

@@ -0,0 +1,46 @@
+<route lang="json5">
+{
+  style: {
+    navigationBarTitleText: '农机详情',
+  },
+}
+</route>
+
+<template>
+  <!-- 选网点,选择机器型号,输入SN号,下订单 -->
+  <view class="bg-white min-h-screen px-4 py-4">
+    <view class="space-y-4">
+      <view class="flex items-center justify-between">
+        <view class="text-lg font-bold">农机详情</view>
+      </view>
+      <!-- 提交按钮 -->
+      <!-- <view class="mt-8 pb-8">
+        <wd-button type="success" block @tap="handleSubmit">提交申请</wd-button>
+      </view> -->
+    </view>
+  </view>
+</template>
+
+<script lang="ts" setup>
+const usersid = ref('')
+const productsid = ref('')
+
+// 提交表单
+function handleSubmit() {
+  // ...
+}
+
+onLoad((query) => {
+  usersid.value = query.usersid
+  productsid.value = query.productsid
+})
+</script>
+
+<style lang="scss" scoped>
+.form-item {
+  @apply mb-6;
+  .form-label {
+    @apply block text-gray-700 mb-2 text-base;
+  }
+}
+</style>

+ 71 - 0
src/pages/form/formStep4.vue

@@ -0,0 +1,71 @@
+<route lang="json5">
+{
+  style: {
+    navigationBarTitleText: '填写sn号',
+  },
+}
+</route>
+
+<template>
+  <!-- 选网点,选择机器型号,输入SN号,下订单 -->
+  <view class="bg-white min-h-screen px-4 py-4">
+    <view class="space-y-4">
+      <!-- 输入SN号 -->
+      <view class="form-item">
+        <text class="form-label">SN号</text>
+        <wd-input v-model="formData.sn" placeholder="请输入SN号" />
+      </view>
+
+      <!-- 提交按钮 -->
+      <view class="mt-8 pb-8">
+        <wd-button type="success" block @tap="handleSubmit">提交申请</wd-button>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { ref } from 'vue'
+import { useUserStore } from '@/store/user'
+import { useMessage } from 'wot-design-uni'
+
+const message = useMessage()
+const userStore = useUserStore()
+const formData = ref({
+  sn: '',
+})
+
+// 提交表单
+function handleSubmit() {
+  // ...
+}
+
+onShow(() => {
+  if (!userStore.isAuthComplete) {
+    message
+      .confirm({
+        msg: '您还未完善个人信息, 无法享受优惠劵活动, 点击按钮完善信息',
+        title: '提示',
+        confirmButtonText: '去完善',
+        cancelButtonText: '我还在考虑',
+      })
+      .then(() => {
+        uni.navigateTo({
+          url: '/pages-sub/user/index',
+        })
+      })
+      .catch(() => {
+        uni.navigateBack()
+      })
+  }
+})
+</script>
+
+<style lang="scss" scoped>
+.form-item {
+  @apply mb-6;
+  .form-label {
+    @apply block text-gray-700 mb-2 text-base;
+  }
+}
+</style>

+ 14 - 16
src/pages/index/index.vue

@@ -87,13 +87,14 @@
 
 <script lang="ts" setup>
 import banner1 from '@/static/banner1.png'
-import { getUserListApi } from '@/service/user'
 import { ref } from 'vue'
-import { until } from '@vueuse/core'
 import { useUserStore } from '@/store/user'
 import { useAppStore } from '@/store/app'
 import { useMessage } from 'wot-design-uni'
+import dayjs from 'dayjs'
 
+const userStore = useUserStore()
+const appStore = useAppStore()
 const message = useMessage()
 const current = ref<number>(0)
 const swiperList = ref([banner1, banner1, banner1])
@@ -115,16 +116,9 @@ const locationList = ref([])
 
 // 获取销售点列表(users表,usersnature=渠道)
 const getUserList = async () => {
-  const { data: userList, loading } = useRequest(
-    () => getUserListApi({ usersnature: '渠道' }, { pageindex: 1, rows: 999 }),
-    {
-      immediate: true,
-    },
-  )
+  const userList = await userStore.getSellUserList()
 
-  await until(loading).toBe(false)
-
-  locationList.value = userList.value.Data.map((item: any) => ({
+  locationList.value = userList.map((item: any) => ({
     name: item.usersname,
     address: item.usersaddress,
     phone: item.usersphone,
@@ -179,7 +173,7 @@ function handleGoods(location: any) {
 // 处理申请
 function handleApply() {
   uni.navigateTo({
-    url: '/pages/form/form',
+    url: '/pages/form/formStep1',
   })
 }
 
@@ -189,10 +183,9 @@ uni.$on('authComplete', function (data) {
   }
 })
 
+// 入口完善信息提示
 const showCompleteDialog = () => {
-  const userStore = useUserStore()
-  const appStore = useAppStore()
-  if (appStore.isLogined && !userStore.isAuthComplete) {
+  if (appStore.isLogined && !userStore.isAuthComplete && appStore.needAlertComplete) {
     message
       .confirm({
         msg: '您还未完善个人信息, 无法享受优惠劵活动, 点击按钮完善信息',
@@ -205,7 +198,12 @@ const showCompleteDialog = () => {
           url: '/pages-sub/user/index',
         })
       })
-      .catch(() => {})
+      .catch(() => {
+        appStore.setAlertCompleteInfo({
+          hasAlert: true,
+          time: dayjs().format('YYYY-MM-DD HH:mm:ss'),
+        })
+      })
   }
 }
 

+ 20 - 0
src/pages/product/detail.vue

@@ -0,0 +1,20 @@
+<route lang="json5" type="page">
+{
+  layout: 'default',
+  style: {
+    navigationBarTitleText: '产品详情',
+  },
+}
+</route>
+
+<template>
+  <view class="">详情</view>
+</template>
+
+<script lang="ts" setup>
+//
+</script>
+
+<style lang="scss" scoped>
+//
+</style>

+ 25 - 0
src/service/product/index.ts

@@ -0,0 +1,25 @@
+import { http } from '@/utils/http'
+import type { ProductType } from '@/types/product'
+import type { ListType, ListResponseType } from '@/types/list'
+import { parseQueryValues } from '@/utils'
+
+/** 商品列表 */
+export const getProductListApi = (params: Partial<ProductType>, page: Partial<ListType>) => {
+  return http.get<ListResponseType<ProductType>>('/api/query/list?pagevalue=23', {
+    ...page,
+    ...parseQueryValues(params),
+  })
+}
+
+/** 获取商品详情 */
+export const getProductDetailApi = (id: string) => {
+  return http.get<ProductType>(
+    '/api/query/view?pagevalue=58',
+    {
+      ...parseQueryValues({ productsid: id }),
+    },
+    {
+      formatData: true,
+    },
+  )
+}

+ 19 - 0
src/store/app.ts

@@ -1,5 +1,6 @@
 import { defineStore } from 'pinia'
 import { ref } from 'vue'
+import dayjs from 'dayjs'
 
 const initState = { token: '', userid: '', openid: '' }
 
@@ -7,6 +8,10 @@ export const useAppStore = defineStore(
   'app',
   () => {
     const appInfo = ref<IAppInfo>({ ...initState })
+    const alertCompleteInfo = ref({
+      hasAlert: false,
+      time: '',
+    })
 
     const setAppInfo = (val: IAppInfo) => {
       appInfo.value = val
@@ -20,6 +25,17 @@ export const useAppStore = defineStore(
       appInfo.value = { ...initState }
     }
     const isLogined = computed(() => !!appInfo.value.token)
+    const needAlertComplete = computed(() => {
+      // 如果已经提示过,并且距离上一次提示的时间在3天以内,则不需要提示
+      if (alertCompleteInfo.value && dayjs().diff(alertCompleteInfo.value.time, 'day') < 3) {
+        return false
+      }
+      return true
+    })
+
+    const setAlertCompleteInfo = (val: { hasAlert: boolean; time: string }) => {
+      alertCompleteInfo.value = val
+    }
 
     return {
       appInfo,
@@ -27,6 +43,9 @@ export const useAppStore = defineStore(
       clearAppInfo,
       isLogined,
       reset,
+      alertCompleteInfo,
+      setAlertCompleteInfo,
+      needAlertComplete,
     }
   },
   {

+ 30 - 0
src/store/product.ts

@@ -0,0 +1,30 @@
+import { defineStore } from 'pinia'
+import { ref } from 'vue'
+import { getProductDetailApi, getProductListApi } from '@/service/product'
+import type { ProductType } from '@/types/product'
+import { until } from '@vueuse/core'
+
+export const useProductStore = defineStore(
+  'product',
+  () => {
+    // 获取产品列表
+    const getProductList = async (productsmerchantid: string) => {
+      const { data: productList, loading } = useRequest(
+        () => getProductListApi({ productsmerchantid }, { pageindex: 1, rows: 999 }),
+        {
+          immediate: true,
+        },
+      )
+
+      await until(loading).toBe(false)
+      return productList.value.Data
+    }
+
+    return {
+      getProductList,
+    }
+  },
+  {
+    persist: true,
+  },
+)

+ 17 - 1
src/store/user.ts

@@ -1,8 +1,9 @@
 import { defineStore } from 'pinia'
 import { ref } from 'vue'
-import { getUserDetailApi, updateUserApi } from '@/service/user'
+import { getUserDetailApi, updateUserApi, getUserListApi } from '@/service/user'
 import { useAppStore } from '@/store/app'
 import type { UserType } from '@/types/user'
+import { until } from '@vueuse/core'
 
 const initState = {
   nickName: '',
@@ -57,6 +58,20 @@ export const useUserStore = defineStore(
       return { Data, Message, Status }
     }
 
+    // 获取销售网点列表
+    const getSellUserList = async () => {
+      const { data: userList, loading } = useRequest(
+        () => getUserListApi({ usersnature: '渠道' }, { pageindex: 1, rows: 999 }),
+        {
+          immediate: true,
+        },
+      )
+
+      await until(loading).toBe(false)
+
+      return userList.value.Data
+    }
+
     return {
       userInfo,
       setUserInfo,
@@ -67,6 +82,7 @@ export const useUserStore = defineStore(
       setUserDetail,
       isAuthComplete,
       updateUser,
+      getSellUserList,
     }
   },
   {

+ 62 - 0
src/types/product.ts

@@ -0,0 +1,62 @@
+/** 产品信息 */
+// CREATE TABLE `products` (
+//   `productsid` varchar(50) NOT NULL COMMENT '产品id',
+//   `productsname` varchar(50) DEFAULT NULL COMMENT '产品名称',
+//   `productscategory` varchar(50) DEFAULT NULL COMMENT '产品类别(耕、种、管、收、运、烘等)',
+//   `productsprice` decimal(10,2) DEFAULT NULL COMMENT '产品原价',
+//   `productsmodel` varchar(50) DEFAULT NULL COMMENT '产品型号',
+//   `productssn` varchar(50) DEFAULT NULL COMMENT '产品sn号',
+//   `productsmerchantid` varchar(50) DEFAULT NULL COMMENT '关联渠道商ID',
+//   `productsdate` datetime DEFAULT NULL COMMENT '创建时间',
+//   `productsscqyid` varchar(50) DEFAULT NULL COMMENT '关联生产企业id',
+//   `productsfl1` varchar(50) DEFAULT NULL COMMENT '产品一级分类',
+//   `productsfl2` varchar(50) DEFAULT NULL COMMENT '产品二级分类',
+//   `productspm` varchar(50) DEFAULT NULL COMMENT '品目',
+//   `productsfdmc` varchar(50) DEFAULT NULL COMMENT '分档名称',
+//   `productsfdbh` varchar(50) DEFAULT NULL COMMENT '分档编号',
+//   `productszybt` decimal(10,2) DEFAULT NULL COMMENT '中央补贴金额',
+//   `productstsxzybt` decimal(10,2) DEFAULT NULL COMMENT '特殊县中央补贴金额',
+//   `productsjjlx` varchar(50) DEFAULT NULL COMMENT '机具类型',
+//   PRIMARY KEY (`productsid`),
+//   KEY `productsmerchantid` (`productsmerchantid`),
+//   CONSTRAINT `productsmerchantid` FOREIGN KEY (`productsmerchantid`) REFERENCES `users` (`usersid`) ON UPDATE NO ACTION
+// ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='产品信息';
+
+interface ProductType {
+  /** 产品id */
+  productsid: string
+  /** 产品名称 */
+  productsname: string
+  /** 产品类别 */
+  productscategory: string
+  /** 产品原价 */
+  productsprice: number
+  /** 产品型号 */
+  productsmodel: string
+  /** 产品sn号 */
+  productssn: string
+  /** 关联渠道商ID */
+  productsmerchantid: string
+  /** 创建时间 */
+  productsdate: string
+  /** 关联生产企业id */
+  productsscqyid: string
+  /** 产品一级分类 */
+  productsfl1: string
+  /** 产品二级分类 */
+  productsfl2: string
+  /** 品目 */
+  productspm: string
+  /** 分档名称 */
+  productsfdmc: string
+  /** 分档编号 */
+  productsfdbh: string
+  /** 中央补贴金额 */
+  productszybt: number
+  /** 特殊县中央补贴金额 */
+  productstsxzybt: number
+  /** 机具类型 */
+  productsjjlx: string
+}
+
+export type { ProductType }

+ 5 - 1
src/types/uni-pages.d.ts

@@ -5,8 +5,12 @@
 
 interface NavigateToOptions {
   url: "/pages/index/index" |
-       "/pages/form/form" |
+       "/pages/form/formStep1" |
+       "/pages/form/formStep2" |
+       "/pages/form/formStep3" |
+       "/pages/form/formStep4" |
        "/pages/mine/index" |
+       "/pages/product/detail" |
        "/pages-sub/auth/index" |
        "/pages-sub/user/index";
 }