From 1172c0ff85963a0f3b8fe5212082462b9ce0b1bc Mon Sep 17 00:00:00 2001 From: peng <peng.com> Date: 星期二, 08 七月 2025 15:52:06 +0800 Subject: [PATCH] 商品发布 --- uni_modules/uni-steps/package.json | 87 +++++++++ uni_modules/uni-steps/readme.md | 13 + pages/supplier/publish-goods/chooseCategery.vue | 61 ++++++ pages.json | 10 + uni_modules/uni-steps/components/uni-steps/uni-steps.vue | 280 +++++++++++++++++++++++++++++++ uni_modules/uni-steps/changelog.md | 18 ++ api/supplier.js | 21 ++ pages/supplier/publish-goods/publishGoods.vue | 37 ++++ 8 files changed, 527 insertions(+), 0 deletions(-) diff --git a/api/supplier.js b/api/supplier.js new file mode 100644 index 0000000..4de4179 --- /dev/null +++ b/api/supplier.js @@ -0,0 +1,21 @@ +/** + * 灏忕▼搴忓晢鎴风API + */ +import { http, Method } from "@/utils/request.js"; + +import api from "@/config/api.js"; + +/** + * 灏忕▼搴忓晢鎴风鑾峰彇搴楅摵缁忚惀鐨勫垎绫� + * + * @param params + */ + export function getMyActivityList() { + return http.request({ + url: "/lmk/supplier/allCategery", + method: Method.GET, + needToken: true, + }); +} + + diff --git a/pages.json b/pages.json index fb8f8b7..869ae4a 100644 --- a/pages.json +++ b/pages.json @@ -1498,6 +1498,16 @@ } }] } + // { + // "root": "pages/supplier/publish-goods", + // "pages": [{ + // "path": "publishGoods", + // "style": { + // "navigationBarTitleText": "鍟嗗搧鍙戝竷" + // // "navigationStyle": "custom" + // } + // }] + // } // , // { // "root": "pages/commodity-square", diff --git a/pages/supplier/publish-goods/chooseCategery.vue b/pages/supplier/publish-goods/chooseCategery.vue new file mode 100644 index 0000000..fe09eff --- /dev/null +++ b/pages/supplier/publish-goods/chooseCategery.vue @@ -0,0 +1,61 @@ +<template> + <view class="container"> + <scroll-view scroll-y="true" style="height: 70vh"> + <view class="categeryContainer"> + <view class="categeryItem" v-for="item in categeryList" :key="item.id" @click="chooseCategery(item.id,item.name)"> + <view class="cateGeryName" :class="{chooseCategeryStyle:chooseCategeryId==item.id}"> + {{item.name}} + </view> + </view> + </view> + </scroll-view> + <view class="">鎮ㄥ綋鍓嶉�夋嫨鐨勫晢鍝佺被鍒槸锛歿{categeryName}}</view> + </view> +</template> + +<script> + import { + getMyActivityList + } from '@/api/merchant.js' + export default { + data() { + return { + categeryName:'', + chooseCategeryId: '', + categeryList: [], + + } + }, + methods:{ + chooseCategery(id,name){ + this.chooseCategeryId =id + this.categeryName = name + } + }, + async mounted() { + const categeryList = await getMyActivityList(); + this.categeryList = categeryList.data.result; + } + } +</script> + +<style> + .categeryContainer { + display: flex; + flex-direction: column; + align-items: flex-start; + justify-content: flex-start; + } + + .categeryItem { + height: 120rpx; + display: flex; + align-items: center; + justify-content: center; + } + .chooseCategeryStyle{ + color: #e06c75; + font-weight: bold; + font-size: 1.2em; + } +</style> \ No newline at end of file diff --git a/pages/supplier/publish-goods/publishGoods.vue b/pages/supplier/publish-goods/publishGoods.vue new file mode 100644 index 0000000..beadba3 --- /dev/null +++ b/pages/supplier/publish-goods/publishGoods.vue @@ -0,0 +1,37 @@ +<template> + <view class="container"> + <uni-steps :options="publishSteps" :active="currentStep" active-color='#f31947'></uni-steps> + <choose-categery v-if="currentStep===0"></choose-categery> + </view> +</template> + +<script> + import chooseCategery from './chooseCategery.vue'; + export default { + components: { chooseCategery }, + data() { + return { + currentStep:0, + publishSteps: [{ + title: ' 閫夋嫨鍟嗗搧鍝佺被' + }, + { + title: ' 濉啓鍟嗗搧璇︽儏' + }, + { + title: ' 鍟嗗搧鍙戝竷鎴愬姛' + } + ], + } + } + + } +</script> + +<style> + .container { + width: 750rpx; + padding: 32rpx; + box-sizing: border-box; + } +</style> \ No newline at end of file diff --git a/uni_modules/uni-steps/changelog.md b/uni_modules/uni-steps/changelog.md new file mode 100644 index 0000000..04367d8 --- /dev/null +++ b/uni_modules/uni-steps/changelog.md @@ -0,0 +1,18 @@ +## 1.1.2锛�2024-03-28锛� +- 淇 uni-steps涓虹珫鎺掑垪鏃讹紝鏂囨湰闀垮害杩囬暱寮曡捣鐐归敊涔辩殑bug +## 1.1.1锛�2021-11-22锛� +- 淇 vue3涓煇浜泂css鍙橀噺鏃犳硶鎵惧埌鐨勯棶棰� +## 1.1.0锛�2021-11-19锛� +- 浼樺寲 缁勪欢UI锛屽苟鎻愪緵璁捐璧勬簮锛岃瑙�:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 鏂囨。杩佺Щ锛岃瑙�:[https://uniapp.dcloud.io/component/uniui/uni-steps](https://uniapp.dcloud.io/component/uniui/uni-steps) +## 1.0.8锛�2021-05-12锛� +- 鏂板 椤圭洰绀轰緥鍦板潃 +## 1.0.7锛�2021-05-06锛� +- 淇 uni-steps 妯悜甯冨眬鏃讹紝澶氳鏂囧瓧楂樺害涓嶅悎鐞嗙殑 bug +## 1.0.6锛�2021-04-21锛� +- 浼樺寲 娣诲姞渚濊禆 uni-icons, 瀵煎叆鍚庤嚜鍔ㄤ笅杞戒緷璧� +## 1.0.5锛�2021-02-05锛� +- 浼樺寲 缁勪欢寮曠敤鍏崇郴锛岄�氳繃uni_modules寮曠敤缁勪欢 + +## 1.0.4锛�2021-02-05锛� +- 璋冩暣涓簎ni_modules鐩綍瑙勮寖 diff --git a/uni_modules/uni-steps/components/uni-steps/uni-steps.vue b/uni_modules/uni-steps/components/uni-steps/uni-steps.vue new file mode 100644 index 0000000..81017fc --- /dev/null +++ b/uni_modules/uni-steps/components/uni-steps/uni-steps.vue @@ -0,0 +1,280 @@ +<template> + <view class="uni-steps"> + <view :class="[direction==='column'?'uni-steps__column':'uni-steps__row']"> + <view :class="[direction==='column'?'uni-steps__column-text-container':'uni-steps__row-text-container']"> + <view v-for="(item,index) in options" :key="index" + :class="[direction==='column'?'uni-steps__column-text':'uni-steps__row-text']"> + <text :style="{color:index === active?activeColor:deactiveColor}" + :class="[direction==='column'?'uni-steps__column-title':'uni-steps__row-title']">{{item.title}}</text> + <text :style="{color: deactiveColor}" + :class="[direction==='column'?'uni-steps__column-desc':'uni-steps__row-desc']">{{item.desc}}</text> + </view> + </view> + <view :class="[direction==='column'?'uni-steps__column-container':'uni-steps__row-container']"> + <view :class="[direction==='column'?'uni-steps__column-line-item':'uni-steps__row-line-item']" + v-for="(item,index) in options" :key="index" :style="{height: direction === 'column'?heightArr[index]+'px':'14px'}"> + <view + :class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',direction==='column'?'uni-steps__column-line--before':'uni-steps__row-line--before']" + :style="{backgroundColor:index<=active&&index!==0?activeColor:index===0?'transparent':deactiveColor}"> + </view> + <view :class="[direction==='column'?'uni-steps__column-check':'uni-steps__row-check']" + v-if="index === active"> + <uni-icons :color="activeColor" :type="activeIcon" size="14" /> + </view> + <view v-else :class="[direction==='column'?'uni-steps__column-circle':'uni-steps__row-circle']" + :style="{backgroundColor:index<active?activeColor:deactiveColor}" /> + <view + :class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',direction==='column'?'uni-steps__column-line--after':'uni-steps__row-line--after']" + :style="{backgroundColor:index<active&&index!==options.length-1?activeColor:index===options.length-1?'transparent':deactiveColor}" /> + </view> + </view> + </view> + </view> +</template> + +<script> + /** + * Steps 姝ラ鏉� + * @description 璇勫垎缁勪欢 + * @tutorial https://ext.dcloud.net.cn/plugin?id=34 + * @property {Number} active 褰撳墠姝ラ + * @property {String} direction = [row|column] 褰撳墠姝ラ + * @value row 妯悜 + * @value column 绾靛悜 + * @property {String} activeColor 閫変腑鐘舵�佺殑棰滆壊 + * @property {Array} options 鏁版嵁婧愶紝鏍煎紡涓猴細[{title:'xxx',desc:'xxx'},{title:'xxx',desc:'xxx'}] + */ + + export default { + name: 'UniSteps', + props: { + direction: { + // 鎺掑垪鏂瑰悜 row column + type: String, + default: 'row' + }, + activeColor: { + // 婵�娲荤姸鎬侀鑹� + type: String, + default: '#2979FF' + }, + deactiveColor: { + // 鏈縺娲荤姸鎬侀鑹� + type: String, + default: '#B7BDC6' + }, + active: { + // 褰撳墠姝ラ + type: Number, + default: 0 + }, + activeIcon: { + // 褰撳墠姝ラ + type: String, + default: 'checkbox-filled' + }, + options: { + type: Array, + default () { + return [] + } + } // 鏁版嵁 + }, + data() { + return { + heightArr: [], + } + }, + mounted() { + //鏍规嵁鍐呭璁剧疆姝ラ鏉$殑闀垮害 + if (this.direction === 'column') { + let that = this; + //鍙兘鐢ㄧ被閫夋嫨鍣紝鐢╥d閫夋嫨鍣ㄦ墍鑾峰彇鐨勫厓绱犱俊鎭笉鍑嗙‘ + uni.createSelectorQuery().in(this).selectAll('.uni-steps__column-text').boundingClientRect(data => { + that.heightArr = data.map(item => item.height + 1); + }).exec() + } + }, + } +</script> + +<style lang="scss"> + $uni-primary: #2979ff !default; + $uni-border-color: #EDEDED; + + .uni-steps { + /* #ifndef APP-NVUE */ + display: flex; + width: 100%; + /* #endif */ + /* #ifdef APP-NVUE */ + flex: 1; + /* #endif */ + flex-direction: column; + } + + .uni-steps__row { + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: column; + } + + .uni-steps__column { + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: row-reverse; + } + + .uni-steps__row-text-container { + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: row; + align-items: flex-end; + margin-bottom: 8px; + } + + .uni-steps__column-text-container { + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: column; + flex: 1; + } + + .uni-steps__row-text { + /* #ifndef APP-NVUE */ + display: inline-flex; + /* #endif */ + flex: 1; + flex-direction: column; + } + + .uni-steps__column-text { + padding: 6px 0px; + border-bottom-style: solid; + border-bottom-width: 1px; + border-bottom-color: $uni-border-color; + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: column; + } + + .uni-steps__row-title { + font-size: 14px; + line-height: 16px; + text-align: center; + } + + .uni-steps__column-title { + font-size: 14px; + text-align: left; + line-height: 18px; + } + + .uni-steps__row-desc { + font-size: 12px; + line-height: 14px; + text-align: center; + } + + .uni-steps__column-desc { + font-size: 12px; + text-align: left; + line-height: 18px; + } + + .uni-steps__row-container { + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: row; + } + + .uni-steps__column-container { + /* #ifndef APP-NVUE */ + display: inline-flex; + /* #endif */ + width: 30px; + flex-direction: column; + } + + .uni-steps__row-line-item { + /* #ifndef APP-NVUE */ + display: inline-flex; + /* #endif */ + flex-direction: row; + flex: 1; + height: 14px; + line-height: 14px; + align-items: center; + justify-content: center; + } + + .uni-steps__column-line-item { + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: column; + align-items: center; + justify-content: center; + } + + .uni-steps__row-line { + flex: 1; + height: 1px; + background-color: #B7BDC6; + } + + .uni-steps__column-line { + width: 1px; + background-color: #B7BDC6; + } + + .uni-steps__row-line--after { + transform: translateX(1px); + } + + .uni-steps__column-line--after { + flex: 1; + transform: translate(0px, 1px); + } + + .uni-steps__row-line--before { + transform: translateX(-1px); + } + + .uni-steps__column-line--before { + height: 6px; + transform: translate(0px, -13px); + } + + .uni-steps__row-circle { + width: 5px; + height: 5px; + border-radius: 50%; + background-color: #B7BDC6; + margin: 0px 3px; + } + + .uni-steps__column-circle { + width: 5px; + height: 5px; + border-radius: 50%; + background-color: #B7BDC6; + margin: 4px 0px 5px 0px; + } + + .uni-steps__row-check { + margin: 0px 6px; + } + + .uni-steps__column-check { + height: 14px; + line-height: 14px; + margin: 2px 0px; + } +</style> diff --git a/uni_modules/uni-steps/package.json b/uni_modules/uni-steps/package.json new file mode 100644 index 0000000..4145ce9 --- /dev/null +++ b/uni_modules/uni-steps/package.json @@ -0,0 +1,87 @@ +{ + "id": "uni-steps", + "displayName": "uni-steps 姝ラ鏉�", + "version": "1.1.2", + "description": "姝ラ鏉$粍浠讹紝鎻愪緵妯悜鍜岀旱鍚戜袱绉嶅竷灞�鏍煎紡銆�", + "keywords": [ + "uni-ui", + "uniui", + "姝ラ鏉�", + "鏃堕棿杞�" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, +"dcloudext": { + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "鏃�", + "data": "鏃�", + "permissions": "鏃�" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", + "type": "component-vue" + }, + "uni_modules": { + "dependencies": [ + "uni-scss", + "uni-icons" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y", + "alipay": "n" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "寰俊娴忚鍣�(Android)": "y", + "QQ娴忚鍣�(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "灏忕▼搴�": { + "寰俊": "y", + "闃块噷": "y", + "鐧惧害": "y", + "瀛楄妭璺冲姩": "y", + "QQ": "y" + }, + "蹇簲鐢�": { + "鍗庝负": "u", + "鑱旂洘": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/uni-steps/readme.md b/uni_modules/uni-steps/readme.md new file mode 100644 index 0000000..da7a4bf --- /dev/null +++ b/uni_modules/uni-steps/readme.md @@ -0,0 +1,13 @@ + + +## Steps 姝ラ鏉� +> **缁勪欢鍚嶏細uni-steps** +> 浠g爜鍧楋細 `uSteps` + + +姝ラ鏉★紝甯哥敤浜庢樉绀鸿繘搴� + +### [鏌ョ湅鏂囨。](https://uniapp.dcloud.io/component/uniui/uni-steps) +#### 濡備娇鐢ㄨ繃绋嬩腑鏈変换浣曢棶棰橈紝鎴栬�呮偍瀵箄ni-ui鏈変竴浜涘ソ鐨勫缓璁紝娆㈣繋鍔犲叆 uni-ui 浜ゆ祦缇わ細871950839 + + -- Gitblit v1.8.0