Handy_Cao vor 3 Monaten
Ursprung
Commit
b3c680fbf4

+ 5 - 5
src/packages/mobile/components/modules/images/Index.vue

@@ -1,7 +1,7 @@
 <template>
-    <app-view class="g-detail" v-if="record" style="background-color: #fff;margin-top: 5px;">
-        <p v-if="record.pictureurl">
-            <img :src="getFileUrl(record.pictureurl)" alt="" />
+    <app-view class="g-detail" v-if="quote" style="background-color: #fff;margin-top: 5px;">
+        <p v-if="quote.pictureurl">
+            <img :src="getFileUrl(quote.pictureurl)" alt="" />
         </p>
     </app-view>
 </template>
@@ -11,8 +11,8 @@ import { PropType } from 'vue'
 import { getFileUrl } from '@/filters'
 
 defineProps({
-    record: {
-        type: Object as PropType<Model.GoodsRsp>
+    quote: {
+        type: Object as PropType<Model.GoodsQuote>
     }
 })
 </script>

+ 17 - 17
src/packages/mobile/views/mall/list/Index.vue

@@ -3,23 +3,23 @@
         <template #header>
             <app-navbar :title="groupInfo ? groupInfo.goodsgroupname : '全款商城'" :show-back-button="showBackButton" />
         </template>
-        <div class="pricing-v2">
-            <div class="pricing-v2-item" v-for="(item, index) in dataList" :key="index">
-                <article>
-                    <h3>
-                        <span>{{ item.goodscode }}</span>
-                    </h3>
-                    <section @click="rowClick(item)">
-                        <dl>
-                            <dt>销售价</dt>
-                            <dd :class="item.askColor">
-                                {{ handleNumberValue(formatDecimal(item.ask, item.decimalplace)) }}
-                            </dd>
-                        </dl>
-                    </section>
-                </article>
-            </div>
-        </div>
+        <Waterfall class="g-goods-waterfall" :data-list="dataList">
+            <template #default="{ item }">
+                <div class="goods" @click="rowClick(item)">
+                    <div class="goods-image">
+                        <img :src="getFileUrl(item.thumurls)" />
+                    </div>
+                    <div class="goods-info">
+                        <div class="goods-info__title">{{ item.goodsname }}/{{ item.goodscode }}</div>
+                        <div class="goods-info__price">
+                            <Tag type="danger" plain>销售价</Tag>
+                            <span class="unit">¥</span>
+                            <span :class="item.askColor">{{ handleNumberValue(formatDecimal(item.ask, item.decimalplace)) }}</span>
+                        </div>
+                    </div>
+                </div>
+            </template>
+        </Waterfall>
     </app-view>
 </template>
 

+ 32 - 4
src/packages/mobile/views/mall/trade/Index.vue

@@ -33,6 +33,11 @@
                     </div>
                 </template>
             </Field>
+            <Field name="Region" v-model="formData.AddrInfo" type="textarea" autosize clearable :rules="formRules.AddrInfo" maxlength="50" label="地址" :placeholder="$t('common.required')">
+                <template #right-icon>
+                    <Icon name="add-o" @click="showContact = true" />
+                </template>
+            </Field>
         </Form>
        <Tabs v-model:active="active">
             <template v-for="(item, index) in components.filter(e => e.show === true)" :key="index">
@@ -41,7 +46,8 @@
                 </Tab>
             </template>
         </Tabs>
-         <template #footer v-if="goods">
+        <app-contact v-model:show="showContact" @change="contactChange" />
+        <template #footer v-if="goods">
             <div class="g-form__footer inset">
                 <Button type="danger" block :disabled="orderQty === 0" @click="onSubmit">
                     {{ $t('operation.buynow') }}
@@ -53,7 +59,7 @@
 
 <script lang="ts" setup>
 import { shallowRef, onMounted, onUnmounted, computed, defineAsyncComponent } from 'vue'
-import { Form, Field, Button, FormInstance, Radio, RadioGroup, Tab, Tabs } from 'vant'
+import { Form, Field, Button, FormInstance, Radio, RadioGroup, Tab, Tabs, Icon, FieldRule } from 'vant'
 import { useFuturesStore, useUserStore, i18n } from '@/stores'
 import { useNavigation } from '@mobile/router/navigation'
 import { currencyFormat } from '@/filters'
@@ -64,6 +70,7 @@ import eventBus from '@/services/bus'
 import quoteSocket from '@/services/websocket/quote'
 import Stepper from '@mobile/components/base/stepper/index.vue'
 import Banner from '@mobile/components/base/banner/index.vue'
+import AppContact from '@mobile/components/modules/contact/index.vue'
 
 const { getQueryString, getQueryStringToNumber, routerBack } = useNavigation()
 
@@ -74,6 +81,8 @@ const goodsid = getQueryStringToNumber('goodsid')
 const quote = futuresStore.getGoodsQuote(goodsCode)
 const goods = futuresStore.getGoods(goodsid)
 
+const showContact = shallowRef(false) // 显示联系人选择列表
+
 const { global: { t } } = i18n
 const subscribe = quoteSocket.createSubscribe()
 
@@ -102,8 +111,8 @@ const marketPrice = computed(() => {
 
 // Banner图
 const topBanners = computed(() => {
-    const { bannerurls } = futuresStore.getGoods(goodsCode) ?? {}
-    return bannerurls?.split(',') ?? []
+    const { thumurls } = futuresStore.getGoods(goodsCode) ?? {}
+    return thumurls?.split(',') ?? []
 })
 
 const pictureurl = computed(() => {
@@ -115,6 +124,25 @@ const onQtyRadioChange = (value: number) => {
     orderQty.value = value
 }
 
+// 选择联系信息
+const contactChange = (item: Model.UserReceiveInfoRsp) => {
+    const contact = `${item.receivername} ${item.phonenum}`
+    const address = `${item.provincename} ${item.cityname} ${item.districtname} ${item.address}`
+    formData.AddrInfo = [contact, address].join('\n')
+    formRef.value?.validate('Region')
+}
+
+// 表单验证规则
+const formRules: { [key: string]: FieldRule[] } = {
+    AddrInfo: [{
+        required: true,
+        message: '请选择地址',
+        validator: () => {
+            return !!formData.AddrInfo
+        }
+    }],
+}
+
 const components = [
     {
         name: 'images',

+ 21 - 19
src/packages/mobile/views/score/list/Index.vue

@@ -3,34 +3,36 @@
         <template #header>
             <app-navbar :title="groupInfo ? groupInfo.goodsgroupname : '积分商城'" :show-back-button="showBackButton" />
         </template>
-        <div class="pricing-v2">
-            <div class="pricing-v2-item" v-for="(item, index) in dataList" :key="index">
-                <article>
-                    <h3>
-                        <span>{{ item.goodscode }}</span>
-                    </h3>
-                    <section @click="rowClick(item)">
-                        <dl>
-                            <dt>积分</dt>
-                            <dd :class="item.askColor">
-                                {{ handleNumberValue(formatDecimal(item.ask, item.decimalplace)) }}
-                            </dd>
-                        </dl>
-                    </section>
-                </article>
-            </div>
-        </div>
+        <Waterfall class="g-goods-waterfall" :data-list="dataList">
+            <template #default="{ item }">
+                <div class="goods" @click="rowClick(item)">
+                    <div class="goods-image">
+                        <img :src="getFileUrl(item.thumurls)" />
+                    </div>
+                    <div class="goods-info">
+                        <div class="goods-info__title">{{ item.goodsname }}/{{ item.goodscode }}</div>
+                        <div class="goods-info__price">
+                            <Tag type="danger" plain>积分</Tag>
+                            <span class="unit">¥</span>
+                            <span :class="item.askColor">{{ handleNumberValue(formatDecimal(item.ask, item.decimalplace)) }}</span>
+                        </div>
+                    </div>
+                </div>
+            </template>
+        </Waterfall>
     </app-view>
 </template>
 
 <script lang="ts" setup>
 import { computed, onUnmounted, onActivated } from 'vue'
-import { handleNumberValue, formatDecimal } from '@/filters'
+import { Tag } from 'vant'
+import { handleNumberValue, formatDecimal, getFileUrl } from '@/filters'
 import { ETradeMode } from '@/constants/client'
 import { useNavigation } from '@mobile/router/navigation'
 import { useUserStore, useFuturesStore, i18n } from '@/stores'
-import quoteSocket from '@/services/websocket/quote'
 import { BuyOrSell, BuildType } from '@/constants/order'
+import quoteSocket from '@/services/websocket/quote'
+import Waterfall from '@mobile/components/base/waterfall/index.vue'
 
 defineProps({
     showBackButton: {

+ 32 - 5
src/packages/mobile/views/score/trade/Index.vue

@@ -33,6 +33,11 @@
                     </div>
                 </template>
             </Field>
+            <Field name="Region" v-model="formData.AddrInfo" type="textarea" autosize clearable :rules="formRules.AddrInfo" maxlength="50" label="地址" :placeholder="$t('common.required')">
+                <template #right-icon>
+                    <Icon name="add-o" @click="showContact = true" />
+                </template>
+            </Field>
         </Form>
        <Tabs v-model:active="active">
             <template v-for="(item, index) in components.filter(e => e.show === true)" :key="index">
@@ -41,7 +46,8 @@
                 </Tab>
             </template>
         </Tabs>
-         <template #footer v-if="goods">
+        <app-contact v-model:show="showContact" @change="contactChange" />
+        <template #footer v-if="goods">
             <div class="g-form__footer inset">
                 <Button type="danger" block :disabled="orderQty === 0" @click="onSubmit">
                     {{ $t('operation.buynow') }}
@@ -53,7 +59,7 @@
 
 <script lang="ts" setup>
 import { shallowRef, onMounted, onUnmounted, computed, defineAsyncComponent } from 'vue'
-import { Form, Field, Button, FormInstance, Radio, RadioGroup, Tab, Tabs } from 'vant'
+import { Form, Field, Button, FormInstance, FieldRule, Radio, RadioGroup, Tab, Tabs, Icon } from 'vant'
 import { useFuturesStore, useUserStore, i18n } from '@/stores'
 import { useNavigation } from '@mobile/router/navigation'
 import { currencyFormat } from '@/filters'
@@ -64,6 +70,7 @@ import eventBus from '@/services/bus'
 import quoteSocket from '@/services/websocket/quote'
 import Stepper from '@mobile/components/base/stepper/index.vue'
 import Banner from '@mobile/components/base/banner/index.vue'
+import AppContact from '@mobile/components/modules/contact/index.vue'
 
 const { getQueryString, getQueryStringToNumber, routerBack } = useNavigation()
 
@@ -79,7 +86,8 @@ const subscribe = quoteSocket.createSubscribe()
 
 const formRef = shallowRef<FormInstance>()
 const { formData, formSubmit } = useOrder()
-
+// 显示联系人选择列表
+const showContact = shallowRef(false) 
 const { getSystemParamValue } = useUserStore()
 const system_1012 = getSystemParamValue('1012') ?? '1'
 
@@ -102,8 +110,8 @@ const marketPrice = computed(() => {
 
 // Banner图
 const topBanners = computed(() => {
-    const { bannerurls } = futuresStore.getGoods(goodsCode) ?? {}
-    return bannerurls?.split(',') ?? []
+    const { thumurls } = futuresStore.getGoods(goodsCode) ?? {}
+    return thumurls?.split(',') ?? []
 })
 
 const pictureurl = computed(() => {
@@ -115,6 +123,25 @@ const onQtyRadioChange = (value: number) => {
     orderQty.value = value
 }
 
+// 选择联系信息
+const contactChange = (item: Model.UserReceiveInfoRsp) => {
+    const contact = `${item.receivername} ${item.phonenum}`
+    const address = `${item.provincename} ${item.cityname} ${item.districtname} ${item.address}`
+    formData.AddrInfo = [contact, address].join('\n')
+    formRef.value?.validate('Region')
+}
+
+// 表单验证规则
+const formRules: { [key: string]: FieldRule[] } = {
+    AddrInfo: [{
+        required: true,
+        message: '请选择地址',
+        validator: () => {
+            return !!formData.AddrInfo
+        }
+    }],
+}
+
 const components = [
     {
         name: 'images',