From 5a72a35e3c9d76299b0d4d2f8f7ca61eff4c1284 Mon Sep 17 00:00:00 2001 From: xuxy <1059738716@qq.com> Date: 星期三, 26 六月 2024 14:12:30 +0800 Subject: [PATCH] update --- common/self.scss | 3 + uni_modules/uni-scss/variables.scss | 2 pages/farmer/flower-manage/flower-add.vue | 68 +++++++++++++++------------------ components/dying318-picker/Picker.vue | 6 ++- pages/farmer/flower-manage/flower-manage.vue | 6 +++ uni_modules/uni-scss/theme.scss | 5 -- uni.scss | 3 + 7 files changed, 48 insertions(+), 45 deletions(-) diff --git a/common/self.scss b/common/self.scss index 6c3992a..37008e5 100644 --- a/common/self.scss +++ b/common/self.scss @@ -13,6 +13,9 @@ --topicgray: #999999; --topicdarkgray: #936E32; } +$u-main-color: #20613D; +$main-color: #20613D; +$u-primary: #20613D; body{ --tcolor: #3140A2; font-family: PingFangSC-Regular, PingFang SC; diff --git a/components/dying318-picker/Picker.vue b/components/dying318-picker/Picker.vue index ee9ba5b..69be89c 100644 --- a/components/dying318-picker/Picker.vue +++ b/components/dying318-picker/Picker.vue @@ -50,8 +50,8 @@ value: Object, default() { return { - value: 'value', - label: 'label', + value: 'id', + label: 'name', children: 'children' } } @@ -131,6 +131,8 @@ this.setColumn(index, pickerList) }) this.reactModel = false; + console.log('init picker',this.pickerList) + } else { this.setColumn(0, this.pickerList) } diff --git a/pages/farmer/flower-manage/flower-add.vue b/pages/farmer/flower-manage/flower-add.vue index 99a077a..740c168 100644 --- a/pages/farmer/flower-manage/flower-add.vue +++ b/pages/farmer/flower-manage/flower-add.vue @@ -144,10 +144,10 @@ 修改 </view> </view> - + <!-- <u-picker @confirm="select_category" keyName="name" @cancel="show_select_category=false" - :show="show_select_category" :columns="columns_categorys"></u-picker> + :show="show_select_category" :columns="columns_categorys"></u-picker> --> <u-picker @confirm="select_level" keyName="label" @cancel="show_select_level=false" :show="show_select_level" :columns="columns_levels"></u-picker> @@ -173,8 +173,8 @@ <view class="button-green" @click="closeParamPop">返回</view> </view> </uni-popup> - - <dying318picker :pickerList="columns_categorys" ref="picker_category" :pickerKey="pickerKey"></dying318picker> + <dying318picker :picker-list="columns_categorys" ref="picker_category" @confirm="confirmPickerCategory"> + </dying318picker> </view> </template> @@ -210,22 +210,17 @@ columns_categorys: [], columns_levels: [], // columns_params: [], //弹窗选择具体的值 - pickerKey: { - value: 'id', - lable: 'name', - children: 'children' + cancel: { + color: '#999', }, - cancel: { - color: '#999', - }, - confirm: { - color: '#20613D', - }, - // column: [ - // {flex: 1}, - // {flex: 1}, - // {flex: 3}, - // ] + confirm: { + color: '#20613D', + }, + // column: [ + // {flex: 1}, + // {flex: 1}, + // {flex: 3}, + // ] } }, async onLoad(options) { @@ -233,7 +228,8 @@ this.$http.request('get', '/api/flower/category/tree', {}).then(res => { var data = res.data this.columns_categorys = data || [] - console.log('columns_categorys',this.columns_categorys) + console.log('columns_categorys', this.columns_categorys) + // this.columns_categorys = [data || []] // this.columns_categorys[0].unshift({ // label: '全部', @@ -283,27 +279,25 @@ }, methods: { + async confirmPickerCategory(picker) { + console.log('confirmPickerCategory', picker) + var id = picker.value + var name = picker.label + if (id !== this.dto.category) { + if (this.dto.category) { + await this.$message.confirm('修改分类将清空商品参数,确定修改吗') + } + this.dto.categoryStr = name + this.dto.category = id + this.$message.showLoading() + await this.refresh_category() + this.$message.hideLoading() + } + }, closeParamPop() { this.$refs.popup_param.close() }, - async select_category(e) { - if (e.value[0].id !== this.dto.category) { - if (this.dto.category) { - await this.$message.confirm('修改分类将清空商品参数,确定修改吗') - } - console.log('select_category', e) - this.show_select_category = false - this.dto.categoryStr = e.value[0].name - this.dto.category = e.value[0].id - this.$message.showLoading() - await this.refresh_category() - this.$message.hideLoading() - } else { - - } - - }, async refresh_category() { // this.columns_params = [] this.dto.params = [] diff --git a/pages/farmer/flower-manage/flower-manage.vue b/pages/farmer/flower-manage/flower-manage.vue index 2e1e6f1..2609a49 100644 --- a/pages/farmer/flower-manage/flower-manage.vue +++ b/pages/farmer/flower-manage/flower-manage.vue @@ -81,8 +81,14 @@ <view class="component-popup_input"> <!-- 输入框--> + <!-- #ifdef H5 --> <uni-easyinput class="p9-12" maxlength="100" type="textarea" v-model="content" :placeholder="inputplaceholder"></uni-easyinput> + <!-- #endif --> + <!-- #ifdef MP --> + <input v-model="content" :placeholder="inputplaceholder" type="digit" v-if="currentInputKey=='price'"/> + <input v-model="content" :placeholder="inputplaceholder" type="number" v-if="currentInputKey=='stock'"/> + <!-- #endif --> <!-- 提交按钮 --> <view class="button-green" @click="submitValue">提交</view> diff --git a/uni.scss b/uni.scss index ce00c66..24a3417 100644 --- a/uni.scss +++ b/uni.scss @@ -1,4 +1,7 @@ /* uni.scss */ +@import '@/common/self.scss'; +$u-primary: $main-color; @import 'uview-ui/theme.scss'; +$u-primary: $main-color; @import '@/uni_modules/uni-scss/variables.scss'; \ No newline at end of file diff --git a/uni_modules/uni-scss/theme.scss b/uni_modules/uni-scss/theme.scss index 8b082ff..80ee62f 100644 --- a/uni_modules/uni-scss/theme.scss +++ b/uni_modules/uni-scss/theme.scss @@ -29,8 +29,3 @@ $uni-black: #000000; $uni-white: #ffffff; $uni-transparent: rgba($color: #000000, $alpha: 0); - -@import "uview-ui/theme.scss"; -@import "uview-ui/index.scss"; - -@import '@/node_modules/uview-ui/theme.scss'; \ No newline at end of file diff --git a/uni_modules/uni-scss/variables.scss b/uni_modules/uni-scss/variables.scss index 1c062d4..6a015fb 100644 --- a/uni_modules/uni-scss/variables.scss +++ b/uni_modules/uni-scss/variables.scss @@ -5,7 +5,7 @@ $uni-radius-root:5px; // 主色 -$uni-primary: #2979ff; +$uni-primary: $main-color; $uni-primary-disable:mix(#fff,$uni-primary,50%); $uni-primary-light: mix(#fff,$uni-primary,80%); -- Gitblit v1.9.3