diff --git a/api/cloud_warehouse.js b/api/cloud_warehouse.js new file mode 100644 index 0000000..f3726de --- /dev/null +++ b/api/cloud_warehouse.js @@ -0,0 +1,29 @@ +import request from "@/utils/request.js"; + +/** + * 获取里海云仓大分类 + * @param + */ +export function getCategory(id, pid) { + let par = {}; + if (pid) { + par['pid'] = pid; + } + return request.get("store/merchant/category/lst/" + id, par); +} + +/** + * 获取里海云仓比例 + * @param + */ +export function getProportion(data) { + return request.get("product/spu/storeLabel", data); +} + +/** + * 里海云仓商品列表 + * @param + */ +export function goodsList(data) { + return request.get("product/spu/merchant/" + data.mer_id, data); +} \ No newline at end of file diff --git a/api/user.js b/api/user.js index 4abb9e2..9c10e99 100644 --- a/api/user.js +++ b/api/user.js @@ -21,12 +21,12 @@ export function getUserInfo() { * */ export function editAvatar(data) { - return request.post('user/change/info',data); + return request.post('user/change/info', data); } // 修改昵称 export function updateInfo(data) { - return request.post('user/change/avatar',data); + return request.post('user/change/avatar', data); } /** * h5用户登录 @@ -114,7 +114,9 @@ export function registerForget(data) { * */ export function getMenuList() { - return request.get("common/menus",{},{noAuth: true}); + return request.get("common/menus", {}, { + noAuth: true + }); } /* * 签到用户信息 @@ -358,7 +360,8 @@ export function getRechargeApi() { * 登陆记录 */ export function setVisit(data) { - return request.post('user/set_visit', { ...data + return request.post('user/set_visit', { + ...data }, { noAuth: true }); @@ -379,7 +382,7 @@ export function serviceLogin(key, data) { * 客服获取客户列表 */ export function serviceUserList(mer_id, data) { - return request.get("service/user_list/"+mer_id, data); + return request.get("service/user_list/" + mer_id, data); } /** * 用户获取聊天记录详情 @@ -413,7 +416,8 @@ export function feedbackType() { * 提交反馈 */ export function feedback(data) { - return request.post("user/feedback", { ...data + return request.post("user/feedback", { + ...data }); } /** @@ -519,7 +523,9 @@ export function imgToBase(data) { * */ export function getAgreementApi(key) { - return request.get('agreement/'+key,{},{noAuth: true}); + return request.get('agreement/' + key, {}, { + noAuth: true + }); } /** * 获取协议 @@ -591,7 +597,9 @@ export function growthValueRecord(data) { * */ export function cacheLst() { - return request.get('agreement_lst',{}, {noAuth: true}) + return request.get('agreement_lst', {}, { + noAuth: true + }) } /** * 协议规则列表对应的数据 @@ -599,7 +607,9 @@ export function cacheLst() { * */ export function cacheInfo(key) { - return request.get(`agreement/${key}`,{}, {noAuth: true}) + return request.get(`agreement/${key}`, {}, { + noAuth: true + }) } /** * 注销账户 @@ -623,7 +633,9 @@ export function serviceUser(merId, uid) { * */ export function serviceSaveMark(merId, uid, mark) { - return request.post(`service/mark/${merId}/${uid}`, {mark}) + return request.post(`service/mark/${merId}/${uid}`, { + mark + }) } /** * 获取会员卡类型 @@ -647,7 +659,9 @@ export function memberCardCreate(id, data) { * */ export function memberEquity() { - return request.get(`svip/user_info`, {}, {noAuth: true}) + return request.get(`svip/user_info`, {}, { + noAuth: true + }) } /** * 付费会员优惠券 @@ -655,7 +669,9 @@ export function memberEquity() { * */ export function memberCouponLst() { - return request.get(`svip/coupon_lst`, {}, {noAuth: true}) + return request.get(`svip/coupon_lst`, {}, { + noAuth: true + }) } /** * 付费会员优惠券--领取 @@ -671,7 +687,9 @@ export function receiveMemberCoupon(id) { * */ export function groomList(data) { - return request.get(`svip/product_lst`, data, {noAuth: true}) + return request.get(`svip/product_lst`, data, { + noAuth: true + }) } /** * 客服聊天--撤回消息 @@ -711,7 +729,7 @@ export function getUserSetting() { * */ export function userSettingEdit(data) { - return request.post(`user/fields/save`, data) + return request.post(`user/fields/save`, data) } /** * 报名活动--详情 @@ -719,14 +737,16 @@ export function userSettingEdit(data) { * */ export function registrateDetail(id) { - return request.get(`system/form/detail/${id}`,{}, {noAuth: true}) + return request.get(`system/form/detail/${id}`, {}, { + noAuth: true + }) } /** * 报名活动--提交数据 * @param object data * */ -export function registrateCreate(id,data) { +export function registrateCreate(id, data) { return request.post(`user/form/create/${id}`, data) } /** @@ -735,7 +755,9 @@ export function registrateCreate(id,data) { * */ export function getRechargeList(data) { - return request.get(`system/form/lst`, data, {noAuth: true}) + return request.get(`system/form/lst`, data, { + noAuth: true + }) } /** * 报名活动--记录 @@ -767,5 +789,13 @@ export function registrateRecordDetail(id) { * */ export function systemFormData(id) { - return request.get(`system/form/info/${id}`, {}, {noAuth: true}) + return request.get(`system/form/info/${id}`, {}, { + noAuth: true + }) +} + + +//填写邀请码 +export function bindPromotionCode(data) { + return request.post(`user/change/bind_promotion_code`, data) } \ No newline at end of file diff --git a/components/emptyPage.vue b/components/emptyPage.vue index 854ccad..29e3463 100644 --- a/components/emptyPage.vue +++ b/components/emptyPage.vue @@ -1,7 +1,7 @@ <template> - <view class="empty-box"> + <view class="empty-box" :style="{'margin-top':mt}"> <image src="/static/images/empty-box.png"></image> - <view class="txt">{{title}}</view> + <view class="txt" :style="{color:color}">{{title}}</view> </view> </template> @@ -15,31 +15,40 @@ // +---------------------------------------------------------------------- // | Author: CRMEB Team <admin@crmeb.com> // +---------------------------------------------------------------------- - export default{ + export default { props: { title: { type: String, default: '暂无记录', }, + color: { + type: String, + default: "#999" + }, + mt: { + type: String, + default: "200rpx" + } }, } - </script> <style lang="scss"> - .empty-box{ + .empty-box { display: flex; flex-direction: column; justify-content: center; align-items: center; margin-top: 200rpx; - image{ + + image { width: 414rpx; height: 240rpx; } - .txt{ + + .txt { font-size: 26rpx; color: #999; } } -</style> +</style> \ No newline at end of file diff --git a/pages.json b/pages.json index 02e1dd0..d2cf50e 100644 --- a/pages.json +++ b/pages.json @@ -145,95 +145,99 @@ "navigationStyle": "custom", "onReachBottomDistance": 300 } + }, { + "path": "pages/rich/rich", + "style": { + "navigationBarTitleText": "政策答疑", + "enablePullDownRefresh": false + } }, - { - "path" : "pages/redpacket/redpacket", - "style" : - { - "navigationBarTitleText" : "补贴", - "enablePullDownRefresh" : false - } - }, - { - "path" : "pages/redpacket/redpack_type", - "style" : - { - "navigationBarTitleText" : "补贴余额", - "enablePullDownRefresh": false, - "navigationStyle": "custom", - "onReachBottomDistance": 300 - } - }, - { - "path" : "pages/newActivity/subsidy/subsidy2", - "style" : - { - "navigationBarTitleText" : "实物通用补贴", - "enablePullDownRefresh": false, - "navigationStyle": "custom", - "onReachBottomDistance": 300 - } - }, - { - "path" : "pages/newActivity/subsidy/subsidy3", - "style" : - { - "navigationBarTitleText" : "现金抵扣补贴", - "enablePullDownRefresh": false, - "navigationStyle": "custom", - "onReachBottomDistance": 300 - } - }, - { - "path" : "pages/newActivity/towPrice/towPrice", - "style" : - { - "navigationBarTitleText" : "两元专区", - "enablePullDownRefresh": false, - "navigationStyle": "custom", - "onReachBottomDistance": 300 - } - }, - { - "path" : "pages/newActivity/giftBag/giftBag", - "style" : - { - "navigationBarTitleText" : "新人礼包", - "enablePullDownRefresh": false, - "navigationStyle": "custom", - "onReachBottomDistance": 300 - } - }, - { - "path" : "pages/newActivity/activityDetail/activityDetail", - "style" : - { - "navigationBarTitleText": "活动", - "enablePullDownRefresh": true, - "navigationStyle": "custom", - "onReachBottomDistance": 300 - } - }, - { - "path" : "pages/newActivity/subsidy/subsidy", - "style" : - { - "navigationBarTitleText": "补贴记录", - "enablePullDownRefresh": true, - "navigationStyle": "custom", - "onReachBottomDistance": 300 - } - }, - { - "path" : "pages/newActivity/invitation/invitation", - "style" : - { - "navigationBarTitleText": "拉新活动", - "enablePullDownRefresh": true, - "navigationStyle": "custom", - "onReachBottomDistance": 300 - } - } + { + "path": "pages/rich/mp4", + "style": { + "navigationBarTitleText": "教学视频", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/redpacket/redpacket", + "style": { + "navigationBarTitleText": "补贴", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/redpacket/redpack_type", + "style": { + "navigationBarTitleText": "补贴余额", + "enablePullDownRefresh": false, + "navigationStyle": "custom", + "onReachBottomDistance": 300 + } + }, + { + "path": "pages/newActivity/subsidy/subsidy2", + "style": { + "navigationBarTitleText": "实物通用补贴", + "enablePullDownRefresh": false, + "navigationStyle": "custom", + "onReachBottomDistance": 300 + } + }, + { + "path": "pages/newActivity/subsidy/subsidy3", + "style": { + "navigationBarTitleText": "现金抵扣补贴", + "enablePullDownRefresh": false, + "navigationStyle": "custom", + "onReachBottomDistance": 300 + } + }, + { + "path": "pages/newActivity/towPrice/towPrice", + "style": { + "navigationBarTitleText": "两元专区", + "enablePullDownRefresh": false, + "navigationStyle": "custom", + "onReachBottomDistance": 300 + } + }, + { + "path": "pages/newActivity/giftBag/giftBag", + "style": { + "navigationBarTitleText": "新人礼包", + "enablePullDownRefresh": false, + "navigationStyle": "custom", + "onReachBottomDistance": 300 + } + }, + { + "path": "pages/newActivity/activityDetail/activityDetail", + "style": { + "navigationBarTitleText": "活动", + "enablePullDownRefresh": true, + "navigationStyle": "custom", + "onReachBottomDistance": 300 + } + }, + { + "path": "pages/newActivity/subsidy/subsidy", + "style": { + "navigationBarTitleText": "补贴记录", + "enablePullDownRefresh": true, + "navigationStyle": "custom", + "onReachBottomDistance": 300 + } + }, + { + "path": "pages/newActivity/invitation/invitation", + "style": { + "navigationBarTitleText": "拉新活动", + "enablePullDownRefresh": true, + "navigationStyle": "custom", + "onReachBottomDistance": 300 + } + } ], "subPackages": [{ "root": "pages/cloud_warehouse", @@ -531,12 +535,12 @@ "navigationBarTitleText": "申请退货" } }, - { - "path": "invite_code/index", - "style": { - "navigationBarTitleText": "邀请码" - } - }, + { + "path": "invite_code/index", + "style": { + "navigationBarTitleText": "邀请码" + } + }, { "path": "login/login_copy", "style": { @@ -727,14 +731,14 @@ "style": { "navigationBarTitleText": "商家入驻" } - }, - { - "path": "settled/unit", - "style": { - "navigationBarTitleText": "种养殖户入驻" - } - }, - { + }, + { + "path": "settled/unit", + "style": { + "navigationBarTitleText": "种养殖户入驻" + } + }, + { "path": "applicationRecord/index", "style": { "navigationBarTitleText": "申请记录" @@ -1459,12 +1463,12 @@ // "selectedIconPath": "static/images/5-002.png", // "text": "逛逛" // }, - { - "pagePath": "pages/gather/gather", - "iconPath": "static/images/2-001.png", - "selectedIconPath": "static/images/2-002.png", - "text": "工作台" - }, + { + "pagePath": "pages/gather/gather", + "iconPath": "static/images/2-001.png", + "selectedIconPath": "static/images/2-002.png", + "text": "工作台" + }, { "pagePath": "pages/order_addcart/order_addcart", "iconPath": "static/images/3-001.png", diff --git a/pages/cloud_warehouse/big_classification/index.vue b/pages/cloud_warehouse/big_classification/index.vue index 9870eb9..d99dc54 100644 --- a/pages/cloud_warehouse/big_classification/index.vue +++ b/pages/cloud_warehouse/big_classification/index.vue @@ -5,30 +5,65 @@ <view style="height: var(--status-bar-height);"></view> <!-- 返回 --> - <view class="back-icon"></view> + <view class="back-icon" @click="handleBack"></view> <!-- 分类 --> <view class="classification"> - <block v-for="item in 20" :key="item"> - <view class="classification-item" @click="goSmallType"> - <image src="/static/cloud_warehouse/pic.webp" mode="" /> + <view class="classification-wrap" v-if="list.length >0"> + <block v-for="item in list" :key="item"> + <view class="classification-item" @click="goSmallType(item)"> + <image :src="item.pic" mode="" /> + </view> + </block> + </view> + + <view class='empty-box' v-if="list.length == 0"> + <view class='pictrue'> + <u--image src='../../../static/images/empty-box.png'></u--image> + <view class="txt">暂无更多分类~</view> </view> - </block> + </view> </view> </view> </template> <script> + import { + getCategory + } from "@/api/cloud_warehouse.js"; export default { data() { return { - list: [] + list: [], + mer_id: '' } }, + + onLoad(opt) { + this.mer_id = opt.id || 259; + this.getData(); + }, + methods: { - goSmallType() { + + getData() { + getCategory(this.mer_id).then(res => { + this.list = res.data; + }) + }, + + // 返回上一页 + handleBack() { + uni.navigateBack({ + delta: 1 + }) + }, + + // 小分类 + goSmallType(e) { uni.navigateTo({ - url: "/pages/cloud_warehouse/small_classification/index" + url: "/pages/cloud_warehouse/small_classification/index?pid=" + e.store_category_id + + '&mer_id=' + this.mer_id }) } } @@ -64,24 +99,47 @@ } .classification { - display: flex; - flex-wrap: wrap; + margin: 0 20rpx; padding-top: 490rpx; - .classification-item { - width: 346rpx; - height: 160rpx; - margin-bottom: 18rpx; + .classification-wrap { + display: flex; + flex-wrap: wrap; - &:nth-child(2n-1) { - margin-right: 18rpx; - } + .classification-item { + width: 346rpx; + height: 160rpx; + margin-bottom: 18rpx; - image { - width: 100%; - height: 100%; + &:nth-child(2n-1) { + margin-right: 18rpx; + } + + image { + width: 100%; + height: 100%; + } } } } + + .empty-box { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + margin: 100rpx auto 0; + + image { + width: 414rpx; + height: 240rpx; + } + + .txt { + font-size: 26rpx; + color: #999; + text-align: center; + } + } </style> \ No newline at end of file diff --git a/pages/cloud_warehouse/small_classification/index.vue b/pages/cloud_warehouse/small_classification/index.vue index d492f1e..60d2342 100644 --- a/pages/cloud_warehouse/small_classification/index.vue +++ b/pages/cloud_warehouse/small_classification/index.vue @@ -6,87 +6,76 @@ <!-- 搜索 --> <view class="search"> - <view class="icon" /> + <view class="icon" @click="handleBack" /> <view class="input-wrap"> <icon type="search" size="18" /> <input type="text" class="uni-input" placeholder="搜索商品" @input="" /> </view> </view> - <!-- 商品 --> + <!-- goods --> <view class="con"> <view class="con-left" :style="{'height':leftDomHeight}"> - <view class="con-left-bili_num_1" @click="handleChooseSideBar"> - <image src="../../../static/cloud_warehouse/hf.webp" /> - <text>化肥</text> - </view> - <view class="con-left-bili_num_2"> - <image src="../../../static/cloud_warehouse/nj.webp" /> - <text>农具</text> - </view> - <view class="con-left-bili_num_3"> - <image src="../../../static/cloud_warehouse/ny.webp" /> - <text>农药</text> - </view> - <view class="con-left-bili_num_4"> - <image src="../../../static/cloud_warehouse/sl.webp" /> - <text class="active">饲料</text> - </view> - <view class="con-left-bili_num_5"> - <image src="../../../static/cloud_warehouse/sy.webp" /> - <text>兽药</text> - </view> - <view class="con-left-bili_num_6"> - <image src="../../../static/cloud_warehouse/zz.webp" /> - <text>种子</text> - </view> - <view class="con-left-bili_num_6"> - <image src="../../../static/cloud_warehouse/zz.webp" /> - <text>种子</text> - </view> - <view class="con-left-bili_num_6"> - <image src="../../../static/cloud_warehouse/zz.webp" /> - <text>种子</text> - </view> - <view class="con-left-bili_num_6"> - <image src="../../../static/cloud_warehouse/zz.webp" /> - <text>种子</text> - </view> + <!-- 侧边栏商品类型 --> + <block v-for="(item,indx) in cateData" :key="indx"> + <view class="con-left-bili_num_2" @click="handleChooseSideBar(item.store_category_id)"> + <u--image :src="item.pic" width="100rpx" height="100rpx" style="margin-bottom: 20rpx;"> + <template v-slot:loading> + <u-loading-icon color="#999"></u-loading-icon> + </template> + </u--image> + <text class="cate-name" + :class="{active:searchParam.mer_cate_id == item.store_category_id?true:false}">{{item.cate_name}}</text> + </view> + </block> </view> <view class="con-right"> + <!-- 补贴比例标签 --> <view class="con-right-proportion"> <image src="../../../static/cloud_warehouse/dkbl.png" /> - <view class="con-right-proportion-item" :class="{active:propIndx == 1}" - @click="handleChooseProp(1)">1:9</view> - <view class="con-right-proportion-item" :class="{active:propIndx == 2}" - @click="handleChooseProp(2)">2:8</view> - <view class="con-right-proportion-item" :class="{active:propIndx == 3}" - @click="handleChooseProp(3)">3:7</view> - <view class="con-right-proportion-item" :class="{active:propIndx == 4}" - @click="handleChooseProp(4)">4:6</view> + <block v-for="(item,indx) in propotionData" :key="indx"> + <view class="con-right-proportion-item" :class="{active:searchParam.deduction_rate == indx + 1}" + @click="handleChooseProp(indx + 1)">{{item.label_name}}</view> + </block> </view> + <!-- 商品列表 --> <scroll-view scroll-y="true" class="con-right-goods" :style="{'height':goodsListHeight}" - :show-scrollbar="false" :scroll-with-animation="true"> - <view class="con-right-goods-item" v-for="item in 10"> - <view class="goods-item-left"> - <image src="" mode=""></image> + :show-scrollbar="false" :scroll-with-animation="true" @scrolltolower="scrolltolower"> + <view v-if="goodsData.length > 0"> + <view class="con-right-goods-item" v-for="(item,indx) in goodsData" :key="indx"> + <view class="goods-item-left"> + <u--image :src="item.image" width="190rpx" height="190rpx" radius="10" /> + </view> + <view class="goods-item-right"> + <view class="goods-item-right-title"> + <text class="city">同城</text> + <text class="name line1">{{item.store_name}}</text> + </view> + <view class="goods-item-right-redpackat line1">可使用补贴抵扣20%</view> + <view class="goods-item-right-rules"> + <text class="unit">规格:1{{item.unit_name}}</text> + <!-- 方山镇 --> + <text class="addr"></text> + </view> + <view class="goods-item-right-purchase"> + <text class="num">¥{{item.price}}</text> + <text class="buy"></text> + </view> + </view> </view> - <view class="goods-item-right"> - <view class="goods-item-right-title"> - <text class="city">同城</text> - <text class="name line1">费大壮催肥猪饲料</text> - </view> - <view class="goods-item-right-redpackat line1">可使用补贴抵扣20%</view> - <view class="goods-item-right-rules"> - <text class="unit">规格:1袋50kg</text> - <text class="addr">方山镇</text> - </view> - <view class="goods-item-right-purchase"> - <text class="num">¥80</text> - <text class="buy"></text> - </view> + <view class="loadingicon acea-row row-center-wrapper" style="color: #ccc;"> + <text class="loading iconfont icon-jiazai" :hidden="hotLoading == false"></text> + {{ hotTitle }} + </view> + </view> + + <view class='empty-box' v-else> + <view class='pictrue'> + <u--image src='../../../static/images/empty-box.png' width="414rpx" + height="240rpx"></u--image> + <view class="txt">暂无更多商品~</view> </view> </view> </scroll-view> @@ -111,41 +100,116 @@ </template> <script> + import { + getProportion, + getCategory, + goodsList + } from "@/api/cloud_warehouse.js"; export default { data() { return { - propIndx: '', //比例 - sideBarIndx: '', //侧边栏 leftDomHeight: 0, //左侧农产品类型高度 goodsListHeight: 0, //右侧商品列表高度 + propotionData: [], //比例 + cateData: [], //分类 + goodsData: [], //商品列表 + pid: '', //上一级id + searchParam: { + mer_cate_id: '', //商品类型id + mer_id: '', //商铺id + deduction_rate: '', //抵扣比例id + keyword: '', //关键字查询 + page: 1, + limit: 10 + }, + // 滚动加载 + hotTitle: '加载更多', + hotLoading: false, + hotScroll: true, } }, - onLoad() { + onLoad(opt) { + this.pid = opt.pid; + this.searchParam.mer_id = opt.mer_id; //商铺id + this.initHeight(); this.initGoodsListHeight(); + this.initConfig(); }, methods: { - - // 选择位置 - changeMap() { - - console.log(11); - uni.navigateTo({ - url: `/pages/cloud_warehouse/select_address/index`, - success: () => { - uni.$once('changeAddress', (e) => {}) - }, - fail(e) { - console.log(e); - } + // 返回 + handleBack() { + uni.navigateBack({ + delta: 1 }) }, - handleChooseProp(e) { - this.propIndx = e; + // 初始化商品列表参数 + initConfig() { + uni.showLoading({ + title: "加载中", + }) + Promise.all([getProportion({ + mer_id: this.searchParam.mer_id + }), getCategory(this.searchParam.mer_id, this.pid)]).then(res => { + uni.hideLoading(); + const [proportion, cate] = res; + this.cateData = cate.data; + this.propotionData = proportion.data; + + //初始化 + this.searchParam.mer_cate_id = this.cateData[0].store_category_id; + this.searchParam.deduction_rate = this.propotionData[0].product_label_id; + + this.getGoodsList(); + }).catch(er => { + uni.hideLoading(); + }) }, + + // 滚动到底部 + scrolltolower(e) { + this.getGoodsList(); + }, + + // 获取商品分类列表 + getGoodsList() { + let that = this; + let num = that.searchParam.limit; + if (!that.hotScroll) return; + if (that.hotLoading) return; + that.hotLoading = true; + that.hotTitle = ''; + console.log(this.searchParam.page); + goodsList(this.searchParam).then(res => { + let list = res.data.list; + let hotScroll; + if (list.length < num && list.length != 0 || list.length == 0) + hotScroll = true; + else + hotScroll = false; + that.hotScroll = hotScroll; + that.hotLoading = false; + that.hotTitle = hotScroll ? '已全部加载' : '加载更多'; + that.goodsData = that.goodsData.concat(list); + that.searchParam.page += 1; + }); + }, + + // 比例 + handleChooseProp(e) { + this.goodsData = []; + this.searchParam.page = 1; + this.searchParam.deduction_rate = e; + this.getGoodsList(); + }, + + // 侧边栏商品类型 handleChooseSideBar(e) { - this.sideBarIndx = e; + this.goodsData = []; + this.searchParam.page = 1; + this.searchParam.mer_cate_id = e; + this.getGoodsList(); }, // 具体商品列表高度 @@ -214,6 +278,7 @@ } .input-wrap { + flex: 1; display: flex; align-items: center; background: #FFFFFF; @@ -273,12 +338,6 @@ align-items: center; margin-bottom: 30rpx; - image { - width: 100rpx; - height: 100rpx; - margin-bottom: 20rpx; - } - text { position: relative; display: inline-block; @@ -286,6 +345,8 @@ font-family: PingFang SC; font-weight: 400; color: #262626; + text-align: center; + width: 80%; } .active { @@ -358,22 +419,16 @@ border-radius: 30rpx; .goods-item-left { - width: 190rpx; - height: 190rpx; background: #A3CAB9; border-radius: 20rpx; margin-right: 20rpx; - - image { - width: 100%; - height: 100%; - } } .goods-item-right { flex: 1; .goods-item-right-title { + display: flex; margin-bottom: 20rpx; .city { @@ -389,12 +444,13 @@ .name { width: 206rpx; - height: 24rpx; + height: 28rpx; font-size: 26rpx; font-family: PingFang SC; - font-weight: 400; color: #1A1A1A; - + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; } } @@ -549,5 +605,24 @@ text-align: center; } } + + .empty-box { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + margin: 100rpx auto 0; + + image { + width: 414rpx; + height: 240rpx; + } + + .txt { + font-size: 26rpx; + color: #999; + text-align: center; + } + } } </style> \ No newline at end of file diff --git a/pages/helpPeople/formTable.vue b/pages/helpPeople/formTable.vue index c25c60e..bc1f985 100644 --- a/pages/helpPeople/formTable.vue +++ b/pages/helpPeople/formTable.vue @@ -9,8 +9,7 @@ 户主姓名 </view> <view class="value"> - <u--input placeholder="请输入户主姓名" v-model="formData.name" color='#7A7A7A' - border="none"></u--input> + <u--input v-model="formData.name" color='#7A7A7A' border="none"></u--input> </view> </view> <view class="item"> @@ -18,8 +17,7 @@ 联系方式 </view> <view class="value"> - <u--input placeholder="请输入联系方式" v-model="formData.contact" color='#7A7A7A' - border="none"></u--input> + <u--input v-model="formData.contact" color='#7A7A7A' border="none"></u--input> </view> </view> <view class="item"> @@ -27,8 +25,7 @@ 家庭人数 </view> <view class="value"> - <u--input placeholder="请输入家庭人数" v-model="formData.family_count" color='#7A7A7A' - border="none"></u--input> + <u--input v-model="formData.family_count" color='#7A7A7A' border="none"></u--input> </view> </view> <view class="item"> @@ -36,15 +33,14 @@ 家庭地址 </view> <view class="value" style="width: 400rpx;"> - <u--input placeholder="请输入家庭地址" v-model="formData.address" color='#7A7A7A' - border="none"></u--input> + <u--input v-model="formData.address" color='#7A7A7A' border="none"></u--input> </view> </view> </view> </view> <view class="tit"> - <view class="help_people"> + <view class=""> 助民惠农 </view> <view class=""> @@ -56,8 +52,8 @@ <view class=""> <view class="card"> <view class="card-tit"> - <view class="" style="font-size: 32rpx;color: #20A162;display: flex;align-items: center;"> - <view class="" :style="{color:SaveList[0]?'#20A162':'' }"> + <view class="" style="font-size: 32rpx;color: #7A7A7A;display: flex;align-items: center;"> + <view class="" :style="{color:SaveList[0]?'#FF5E0C':'' }"> 房子出租需求 </view> <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/52556202401271437309444.png" @@ -65,11 +61,12 @@ @click='showFn(0)' /> </view> <view class="" style="display: flex;align-items: center;color: #7A7A7A;" @click='open(0)'> - <text :style="{color:SaveList[0]?'#20A162':'' }">{{SaveList[0]?'已完成':'展开'}}</text> + 展开 <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/bceaf202401271439428345.png" width="24rpx" height="24rpx" class='icon' :style=" {transform:isOpen[0]? 'rotate(180deg)' :'rotate(0)'} " /> </view> + </view> </view> <!-- :style="{height:isOpen[0]?'0':getFormHeight('#formheight')+'px',padding: isOpen[0]?'0':'20rpx' } " --> @@ -77,13 +74,13 @@ style="height: 0;padding: 0;"> <view id="formheight1"> <view class="form-tit"> - <view class="" :style="{color:SaveList[0]?'#20A162':'' }"> + <view class="" :style="{color:SaveList[0]?'#FF5E0C':'' }"> 房子出租需求 </view> <view class="submit" v-if='!SaveList[0]' @click="sava(0,'house_rent_info')"> 保存 </view> - <view class="edit-btn edit-btn" v-if='SaveList[0]' @click="edit(0)"> + <view class="edit-btn" v-if='SaveList[0]' @click="edit(0)"> 编辑 </view> </view> @@ -134,16 +131,19 @@ </view> </view> </view> + </view> + + </view> </view> - <!-- content --> + <view class=""> <view class="card"> <view class="card-tit"> <view class="" style="font-size: 32rpx;color: #7A7A7A;display: flex;align-items: center;"> - <view class="" :style="{color:SaveList[1]?'#20A162':'' }"> + <view class="" :style="{color:SaveList[1]?'#FF5E0C':'' }"> 空闲土地出租需求 </view> <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/52556202401271437309444.png" @@ -151,7 +151,7 @@ @click='showFn(1)' /> </view> <view class="" style="display: flex;align-items: center;color: #7A7A7A;" @click='open(1)'> - <text :style="{color:SaveList[1]?'#20A162':'' }">{{SaveList[1]?'已完成':'展开'}}</text> + 展开 <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/bceaf202401271439428345.png" width="24rpx" height="24rpx" class='icon' :style=" {transform:isOpen[1]? 'rotate(180deg)' :'rotate(0)'} " /> @@ -170,7 +170,7 @@ <view class="submit" v-if='!SaveList[1]' @click="sava(1,'land_rent_info')"> 保存 </view> - <view class="submit edit-btn" v-if='SaveList[1]' @click="edit(1)"> + <view class="submit" v-if='SaveList[1]' @click="edit(1)"> 编辑 </view> </view> @@ -248,7 +248,9 @@ </view> </view> </view> + </view> + </view> </view> <!-- content --> @@ -256,7 +258,7 @@ <view class="card"> <view class="card-tit"> <view class="" style="font-size: 32rpx;color: #7A7A7A;display: flex;align-items: center;"> - <view class="" :style="{color:SaveList[2]?'#20A162':'' }"> + <view class="" :style="{color:SaveList[2]?'#FF5E0C':'' }"> 农副产品出售需求 </view> <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/52556202401271437309444.png" @@ -264,11 +266,12 @@ @click='showFn(2)' /> </view> <view class="" style="display: flex;align-items: center;color: #7A7A7A;" @click='open(2)'> - <text :style="{color:SaveList[2]?'#20A162':'' }">{{SaveList[2]?'已完成':'展开'}}</text> + 展开 <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/bceaf202401271439428345.png" width="24rpx" height="24rpx" class='icon' :style=" {transform:isOpen[2]? 'rotate(180deg)' :'rotate(0)'} " /> </view> + </view> </view> @@ -282,7 +285,7 @@ <view class="submit" v-if='!SaveList[2]' @click="sava(2,'product_info')"> 保存 </view> - <view class="submit edit-btn" v-if='SaveList[2]' @click="edit(2)"> + <view class="submit" v-if='SaveList[2]' @click="edit(2)"> 编辑 </view> </view> @@ -432,7 +435,9 @@ </view> </view> </view> + </view> + </view> </view> <!-- content --> @@ -441,7 +446,7 @@ <view class="card"> <view class="card-tit"> <view class="" style="font-size: 32rpx;color: #7A7A7A;display: flex;align-items: center;"> - <view class="" :style="{color:SaveList[3]?'#20A162':'' }"> + <view class="" :style="{color:SaveList[3]?'#FF5E0C':'' }"> 空闲资产出租/出售需求 </view> <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/52556202401271437309444.png" @@ -449,11 +454,12 @@ @click='showFn(3)' /> </view> <view class="" style="display: flex;align-items: center;color: #7A7A7A;" @click='open(3)'> - <text :style="{color:SaveList[3]?'#20A162':'' }">{{SaveList[3]?'已完成':'展开'}}</text> + 展开 <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/bceaf202401271439428345.png" width="24rpx" height="24rpx" class='icon' :style=" {transform:isOpen[3]? 'rotate(180deg)' :'rotate(0)'} " /> </view> + </view> </view> @@ -467,7 +473,7 @@ <view class="submit" v-if='!SaveList[3]' @click="sava(3,'idle_asset_rent_info')"> 保存 </view> - <view class="submit edit-btn" v-if='SaveList[3]' @click="edit(3)"> + <view class="submit" v-if='SaveList[3]' @click="edit(3)"> 编辑 </view> </view> @@ -518,7 +524,10 @@ </view> </view> </view> + </view> + + </view> </view> <!-- content --> @@ -527,7 +536,7 @@ <view class="card"> <view class="card-tit"> <view class="" style="font-size: 32rpx;color: #7A7A7A;display: flex;align-items: center;"> - <view class="" :style="{color:SaveList[4]?'#20A162':'' }"> + <view class="" :style="{color:SaveList[4]?'#FF5E0C':'' }"> 房屋装饰建设 </view> <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/52556202401271437309444.png" @@ -535,7 +544,7 @@ @click='showFn(4)' /> </view> <view class="" style="display: flex;align-items: center;color: #7A7A7A;" @click='open(4)'> - <text :style="{color:SaveList[4]?'#20A162':'' }">{{SaveList[4]?'已完成':'展开'}}</text> + 展开 <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/bceaf202401271439428345.png" width="24rpx" height="24rpx" class='icon' :style=" {transform:isOpen[4]? 'rotate(180deg)' :'rotate(0)'} " /> @@ -554,7 +563,7 @@ <view class="submit" v-if='!SaveList[4]' @click="sava(4,'house_decoration_construction')"> 保存 </view> - <view class="submit edit-btn" v-if='SaveList[4]' @click="edit(4)"> + <view class="submit" v-if='SaveList[4]' @click="edit(4)"> 编辑 </view> </view> @@ -614,12 +623,14 @@ </view> </view> </view> + </view> + </view> </view> - <!-- content --> - <view class="login-btn" @click="submit" :class="{'login-btn-no':saveNum < 2 ?true:false}"> + <view class="login-btn" @click="submit" + :style="{background:saveNum<2 ? '#F5F5F5':'',color:saveNum<2 ? '#ADADAD':'' }"> 确认提交 </view> @@ -639,6 +650,7 @@ </view> </view> </u-overlay> + </view> </template> @@ -878,7 +890,7 @@ </script> <style lang="scss" scoped> .box { - background: #F5F5F5; + background: linear-gradient(to bottom, #FFF4DB, #FFEAC3); min-height: 100vh; font-size: 28rpx; padding-bottom: 5vh; @@ -887,15 +899,16 @@ .bg { width: 750rpx; height: 660rpx; - background-image: url('https://lihai001.oss-cn-chengdu.aliyuncs.com/def/c7e26202402261051094476.webp'); + background-image: url('https://lihai001.oss-cn-chengdu.aliyuncs.com/def/44f25202401271436185198.png'); background-size: 100% 100%; position: relative; + } .user-info { - width: 686rpx; + width: 750rpx; margin: 0 auto; - // height: 550rpx; + height: 550rpx; background-image: url('https://lihai001.oss-cn-chengdu.aliyuncs.com/def/549b3202401271438211224.png'); background-size: 100% 100%; position: absolute; @@ -903,34 +916,29 @@ left: 50%; transform: translateX(-50%); box-sizing: border-box; - padding: 36rpx 40rpx; + padding: 70rpx; display: flex; flex-direction: column; justify-content: space-between; - - - box-shadow: 0rpx 3rpx 12rpx 1rpx #D6D6D6; - background: #FFFFFF; - box-shadow: 0rpx 3rpx 12rpx 1rpx #D6D6D6; - border-radius: 40rpx 40rpx 40rpx 40rpx; - } .item { display: flex; align-items: center; - margin-bottom: 56rpx; + padding-bottom: 30rpx; + border-bottom: 1px solid #FFF2D9; + padding-top: 10rpx; + // background-color: red; + margin-bottom: 10rpx; + - &:nth-last-child(1) { - margin-bottom: 0; - } .lable { - font-weight: 600; - font-size: 26rpx; - color: #262626; + font-size: 28rpx; + color: #2E2E2E; + font-weight: 700; + width: 112rpx; text-align: center; - white-space: nowrap; } .value { @@ -943,11 +951,10 @@ .tit { display: flex; width: 638rpx; - margin: 180rpx auto 30rpx; + margin: 230rpx auto 30rpx; justify-content: space-between; font-size: 28rpx; color: #2E2E2E; - font-weight: 600; } .card { @@ -989,17 +996,23 @@ color: white; } + + // right: 0; + + } } .card-content { + background-color: #FFE7B9; border-radius: 20rpx; padding: 20rpx; overflow: hidden; transition: 300ms; width: 690rpx; margin: 30rpx auto; - background: #DFF6E0; + + .form { background-color: #fff; @@ -1010,7 +1023,7 @@ .form-tit { font-size: 32rpx; - color: #20A162; + color: #FF5E0C; display: flex; align-items: center; display: flex; @@ -1019,31 +1032,33 @@ .submit { width: 162rpx; height: 58rpx; - line-height: 58rpx; - border-radius: 48rpx; + background: #FD7F4A; + border-radius: 48rpx 48rpx 48rpx 48rpx; opacity: 1; color: white; text-align: center; - background: linear-gradient(158deg, #20A162 0%, #41B745 100%); - box-shadow: 0rpx 1rpx 2rpx 1rpx #127A19, inset 0rpx 3rpx 4rpx 1rpx #7CDF80; + line-height: 58rpx; } .edit-btn { - width: 132rpx; + width: 162rpx; height: 58rpx; - line-height: 58rpx; - border-radius: 48rpx; - color: #20A162 !important; + // background: #FD7F4A; + color: #FD7F4A !important; + border: 1px solid #FD7F4A; + border-radius: 48rpx 48rpx 48rpx 48rpx; + opacity: 1; + color: white; text-align: center; - box-shadow: 0rpx 1rpx 2rpx 1rpx #2B8131; - border: 1rpx solid #20A162; - background: transparent; + line-height: 50rpx; } .submit:active { background-color: grey; } } + + } .icon { @@ -1059,9 +1074,10 @@ top: 50%; left: 50%; transform: translate(-50%, -50%); - background-image: url('https://lihai001.oss-cn-chengdu.aliyuncs.com/def/025fc202402261139275710.webp'); + background-image: url('https://lihai001.oss-cn-chengdu.aliyuncs.com/def/56970202401271438059755.png'); background-size: 100% 100%; + .toast-tit { text-align: center; font-size: 32rpx; @@ -1076,6 +1092,7 @@ font-size: 28rpx; color: #7A7A7A; line-height: 42rpx; + } .off { @@ -1088,23 +1105,18 @@ .login-btn { width: 690rpx; height: 88rpx; - line-height: 88rpx; - background: linear-gradient(323deg, #52C973 0%, #20A162 100%); - border-radius: 44rpx; - color: #FFFFFF; - font-weight: 600; - font-size: 30rpx; + background: #FF8056; + border-radius: 44rpx 44rpx 44rpx 44rpx; + opacity: 1; text-align: center; - margin: 0 auto; - } - - .login-btn-no { - background: transparent; - color: #ADADAD; + line-height: 88rpx; + font-size: 30rpx; + color: white; + margin: 50rpx auto; } .login-btn:active { - opacity: .9; + background-color: grey; } .bg_back { diff --git a/pages/helpPeople/formTable_green.vue b/pages/helpPeople/formTable_green.vue new file mode 100644 index 0000000..c25c60e --- /dev/null +++ b/pages/helpPeople/formTable_green.vue @@ -0,0 +1,1118 @@ +<template> + <view class="box" style="position: relative;"> + <image @click="back" class="bg_back" + src="https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/new_activity/back.png"></image> + <view class="bg"> + <view class="user-info"> + <view class="item"> + <view class="lable"> + 户主姓名 + </view> + <view class="value"> + <u--input placeholder="请输入户主姓名" v-model="formData.name" color='#7A7A7A' + border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 联系方式 + </view> + <view class="value"> + <u--input placeholder="请输入联系方式" v-model="formData.contact" color='#7A7A7A' + border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 家庭人数 + </view> + <view class="value"> + <u--input placeholder="请输入家庭人数" v-model="formData.family_count" color='#7A7A7A' + border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 家庭地址 + </view> + <view class="value" style="width: 400rpx;"> + <u--input placeholder="请输入家庭地址" v-model="formData.address" color='#7A7A7A' + border="none"></u--input> + </view> + </view> + </view> + </view> + + <view class="tit"> + <view class="help_people"> + 助民惠农 + </view> + <view class=""> + {{saveNum}}/5 + </view> + </view> + + <!-- content --> + <view class=""> + <view class="card"> + <view class="card-tit"> + <view class="" style="font-size: 32rpx;color: #20A162;display: flex;align-items: center;"> + <view class="" :style="{color:SaveList[0]?'#20A162':'' }"> + 房子出租需求 + </view> + <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/52556202401271437309444.png" + width="36rpx" height="36rpx" style="margin-left: 5rpx;transform: translateY(2rpx);" + @click='showFn(0)' /> + </view> + <view class="" style="display: flex;align-items: center;color: #7A7A7A;" @click='open(0)'> + <text :style="{color:SaveList[0]?'#20A162':'' }">{{SaveList[0]?'已完成':'展开'}}</text> + <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/bceaf202401271439428345.png" + width="24rpx" height="24rpx" class='icon' + :style=" {transform:isOpen[0]? 'rotate(180deg)' :'rotate(0)'} " /> + </view> + </view> + </view> + <!-- :style="{height:isOpen[0]?'0':getFormHeight('#formheight')+'px',padding: isOpen[0]?'0':'20rpx' } " --> + <view class="card-content" :style="{height:isOpen[0]?'0':'auto',padding: isOpen[0]?'0':'20rpx' } " + style="height: 0;padding: 0;"> + <view id="formheight1"> + <view class="form-tit"> + <view class="" :style="{color:SaveList[0]?'#20A162':'' }"> + 房子出租需求 + </view> + <view class="submit" v-if='!SaveList[0]' @click="sava(0,'house_rent_info')"> + 保存 + </view> + <view class="edit-btn edit-btn" v-if='SaveList[0]' @click="edit(0)"> + 编辑 + </view> + </view> + <view class="form"> + <view class="item"> + <view class="lable"> + 面积 + </view> + <view class="value"> + <u--input v-model="formData.house_rent_info.area" :readonly='SaveList[0]' + color='#7A7A7A' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 出租年限 + </view> + <view class="value"> + <u--input v-model="formData.house_rent_info.ageLimit" :readonly='SaveList[0]' + color='#7A7A7A' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 出租要求 + </view> + <view class="value"> + <u--input v-model="formData.house_rent_info.request" :readonly='SaveList[0]' + color='#7A7A7A' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 主题结构是否完整 + </view> + <view class="value"> + <u--input v-model="formData.house_rent_info.isFinish" :readonly='SaveList[0]' + color='#7A7A7A' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 是否允许装修 + </view> + <view class="value"> + <u--input :readonly='SaveList[0]' v-model="formData.house_rent_info.fitment" + color='#7A7A7A' border="none"></u--input> + </view> + </view> + </view> + </view> + </view> + </view> + + <!-- content --> + <view class=""> + <view class="card"> + <view class="card-tit"> + <view class="" style="font-size: 32rpx;color: #7A7A7A;display: flex;align-items: center;"> + <view class="" :style="{color:SaveList[1]?'#20A162':'' }"> + 空闲土地出租需求 + </view> + <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/52556202401271437309444.png" + width="36rpx" height="36rpx" style="margin-left: 5rpx;transform: translateY(2rpx);" + @click='showFn(1)' /> + </view> + <view class="" style="display: flex;align-items: center;color: #7A7A7A;" @click='open(1)'> + <text :style="{color:SaveList[1]?'#20A162':'' }">{{SaveList[1]?'已完成':'展开'}}</text> + <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/bceaf202401271439428345.png" + width="24rpx" height="24rpx" class='icon' + :style=" {transform:isOpen[1]? 'rotate(180deg)' :'rotate(0)'} " /> + </view> + + </view> + </view> + + <view class="card-content" :style="{height:isOpen[1]?'0':'auto',padding: isOpen[1]?'0':'20rpx' } " + style="height: 0;padding: 0;"> + <view id="formheight2"> + <view class="form-tit"> + <view class=""> + 空闲土地出租需求 + </view> + <view class="submit" v-if='!SaveList[1]' @click="sava(1,'land_rent_info')"> + 保存 + </view> + <view class="submit edit-btn" v-if='SaveList[1]' @click="edit(1)"> + 编辑 + </view> + </view> + <view class="form"> + <view class="item"> + <view class="lable"> + 是否可以种养 + </view> + <view class="value"> + <u--input v-model="formData.land_rent_info.isBreeding" :readonly='SaveList[1]' + color='#7A7A7A' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 面积 + </view> + <view class="value"> + <u--input v-model="formData.land_rent_info.area" :readonly='SaveList[1]' color='#7A7A7A' + border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 种养要求 + </view> + <view class="value"> + <u--input v-model="formData.land_rent_info.request" :readonly='SaveList[1]' + color='#7A7A7A' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 租金和支付方式 + </view> + <view class="value"> + <u--input v-model="formData.land_rent_info.payInfo" :readonly='SaveList[1]' + color='#7A7A7A' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 土地优势 + </view> + <view class="value"> + <u--input v-model="formData.land_rent_info.advantage" :readonly='SaveList[1]' + color='#7A7A7A' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 土地缺点 + </view> + <view class="value"> + <u--input v-model="formData.land_rent_info.shortcoming" color='#7A7A7A' + :readonly='SaveList[1]' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 闲置原因 + </view> + <view class="value"> + <u--input v-model="formData.land_rent_info.reson" color='#7A7A7A' + :readonly='SaveList[1]' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 使用年限 + </view> + <view class="value"> + <u--input v-model="formData.land_rent_info.ageLimit" :readonly='SaveList[1]' + color='#7A7A7A' border="none"></u--input> + </view> + </view> + </view> + </view> + </view> + </view> + <!-- content --> + <view class=""> + <view class="card"> + <view class="card-tit"> + <view class="" style="font-size: 32rpx;color: #7A7A7A;display: flex;align-items: center;"> + <view class="" :style="{color:SaveList[2]?'#20A162':'' }"> + 农副产品出售需求 + </view> + <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/52556202401271437309444.png" + width="36rpx" height="36rpx" style="margin-left: 5rpx;transform: translateY(2rpx);" + @click='showFn(2)' /> + </view> + <view class="" style="display: flex;align-items: center;color: #7A7A7A;" @click='open(2)'> + <text :style="{color:SaveList[2]?'#20A162':'' }">{{SaveList[2]?'已完成':'展开'}}</text> + <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/bceaf202401271439428345.png" + width="24rpx" height="24rpx" class='icon' + :style=" {transform:isOpen[2]? 'rotate(180deg)' :'rotate(0)'} " /> + </view> + </view> + </view> + + <view class="card-content" :style="{height:isOpen[2]?'0':'auto',padding: isOpen[2]?'0':'20rpx' } " + style="height: 0;padding: 0;"> + <view id='formheight3'> + <view class="form-tit"> + <view class=""> + 农副产品出售需求 + </view> + <view class="submit" v-if='!SaveList[2]' @click="sava(2,'product_info')"> + 保存 + </view> + <view class="submit edit-btn" v-if='SaveList[2]' @click="edit(2)"> + 编辑 + </view> + </view> + <view class="form"> + <view class="item"> + <view class="lable"> + 种养类型 + </view> + <view class="value"> + <u--input v-model="formData.product_info.type" color='#7A7A7A' border="none" + :readonly='SaveList[2]'></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 种养面积 + </view> + <view class="value"> + <u--input v-model="formData.product_info.area" :readonly='SaveList[2]' color='#7A7A7A' + border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 土地性质 + </view> + <view class="value"> + <u--input v-model="formData.product_info.quality" :readonly='SaveList[2]' + color='#7A7A7A' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 种养方式 + </view> + <view class="value"> + <u--input v-model="formData.product_info.manner" :readonly='SaveList[2]' color='#7A7A7A' + border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 成熟周期 + </view> + <view class="value"> + <u--input v-model="formData.product_info.maturationCycle" :readonly='SaveList[2]' + color='#7A7A7A' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 最近成熟时间 + </view> + <view class="value"> + <u--input v-model="formData.product_info.maturationTime" :readonly='SaveList[2]' + color='#7A7A7A' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 年产量 + </view> + <view class="value"> + <u--input v-model="formData.product_info.yield" color='#7A7A7A' :readonly='SaveList[2]' + border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 自己消化/市场销售 + </view> + <view class="value"> + <u--input v-model="formData.product_info.sellType" color='#7A7A7A' + :readonly='SaveList[2]' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 销售方式 + </view> + <view class="value"> + <u--input v-model="formData.product_info.sellMethods" :readonly='SaveList[2]' + color='#7A7A7A' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 年销量 + </view> + <view class="value"> + <u--input v-model="formData.product_info.Sales" :readonly='SaveList[2]' color='#7A7A7A' + border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 产品名称 + </view> + <view class="value"> + <u--input v-model="formData.product_info.productName" :readonly='SaveList[2]' + color='#7A7A7A' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 优势 + </view> + <view class="value"> + <u--input v-model="formData.product_info.advantage" :readonly='SaveList[2]' + color='#7A7A7A' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 产品有无品牌 + </view> + <view class="value"> + <u--input :readonly='SaveList[2]' v-model="formData.product_info.isBrand" + color='#7A7A7A' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 是否进行粗加工 + </view> + <view class="value"> + <u--input :readonly='SaveList[2]' v-model="formData.product_info.isProcessing" + color='#7A7A7A' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 产品诉求 + </view> + <view class="value"> + <u--input v-model="formData.product_info.isDemands" color='#7A7A7A' + :readonly='SaveList[2]' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 急需解决的问题 + </view> + <view class="value"> + <u--input v-model="formData.product_info.quesition" color='#7A7A7A' + :readonly='SaveList[2]' border="none"></u--input> + </view> + </view> + </view> + </view> + </view> + </view> + <!-- content --> + + <view class=""> + <view class="card"> + <view class="card-tit"> + <view class="" style="font-size: 32rpx;color: #7A7A7A;display: flex;align-items: center;"> + <view class="" :style="{color:SaveList[3]?'#20A162':'' }"> + 空闲资产出租/出售需求 + </view> + <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/52556202401271437309444.png" + width="36rpx" height="36rpx" style="margin-left: 5rpx;transform: translateY(2rpx);" + @click='showFn(3)' /> + </view> + <view class="" style="display: flex;align-items: center;color: #7A7A7A;" @click='open(3)'> + <text :style="{color:SaveList[3]?'#20A162':'' }">{{SaveList[3]?'已完成':'展开'}}</text> + <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/bceaf202401271439428345.png" + width="24rpx" height="24rpx" class='icon' + :style=" {transform:isOpen[3]? 'rotate(180deg)' :'rotate(0)'} " /> + </view> + </view> + </view> + + <view class="card-content" :style="{height:isOpen[3]?'0':'auto',padding: isOpen[3]?'0':'20rpx' } " + style="height: 0;padding: 0;"> + <view id='formheight4'> + <view class="form-tit"> + <view class=""> + 空闲资产出租/出售需求 + </view> + <view class="submit" v-if='!SaveList[3]' @click="sava(3,'idle_asset_rent_info')"> + 保存 + </view> + <view class="submit edit-btn" v-if='SaveList[3]' @click="edit(3)"> + 编辑 + </view> + </view> + <view class="form"> + <view class="item"> + <view class="lable"> + 资产名称 + </view> + <view class="value"> + <u--input v-model="formData.idle_asset_rent_info.area" color='#7A7A7A' + :readonly='SaveList[3]' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 资产优势 + </view> + <view class="value"> + <u--input v-model="formData.idle_asset_rent_info.advantage" color='#7A7A7A' + :readonly='SaveList[3]' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 数量 + </view> + <view class="value"> + <u--input v-model="formData.idle_asset_rent_info.num" color='#7A7A7A' + :readonly='SaveList[3]' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 增收方式 <text style="font-size: 24rpx;">(出租、出售、置换、捐赠) </text> + </view> + <view class="value"> + <u--input v-model="formData.idle_asset_rent_info.type" color='#7A7A7A' + :readonly='SaveList[3]' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 其他可变现 + </view> + <view class="value"> + <u--input v-model="formData.idle_asset_rent_info.other" color='#7A7A7A' + :readonly='SaveList[3]' border="none"></u--input> + </view> + </view> + </view> + </view> + </view> + </view> + <!-- content --> + + <view class=""> + <view class="card"> + <view class="card-tit"> + <view class="" style="font-size: 32rpx;color: #7A7A7A;display: flex;align-items: center;"> + <view class="" :style="{color:SaveList[4]?'#20A162':'' }"> + 房屋装饰建设 + </view> + <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/52556202401271437309444.png" + width="36rpx" height="36rpx" style="margin-left: 5rpx;transform: translateY(2rpx);" + @click='showFn(4)' /> + </view> + <view class="" style="display: flex;align-items: center;color: #7A7A7A;" @click='open(4)'> + <text :style="{color:SaveList[4]?'#20A162':'' }">{{SaveList[4]?'已完成':'展开'}}</text> + <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/bceaf202401271439428345.png" + width="24rpx" height="24rpx" class='icon' + :style=" {transform:isOpen[4]? 'rotate(180deg)' :'rotate(0)'} " /> + </view> + + </view> + </view> + + <view class="card-content" :style="{height:isOpen[4]?'0':'auto',padding: isOpen[4]?'0':'20rpx' } " + style="height: 0;padding: 0;"> + <view id='formheight5'> + <view class="form-tit"> + <view class=""> + 房屋装饰建设/出售 + </view> + <view class="submit" v-if='!SaveList[4]' @click="sava(4,'house_decoration_construction')"> + 保存 + </view> + <view class="submit edit-btn" v-if='SaveList[4]' @click="edit(4)"> + 编辑 + </view> + </view> + <view class="form"> + <view class="item"> + <view class="lable"> + 施工地点 + </view> + <view class="value"> + <u--input v-model="formData.house_decoration_construction.area" color='#7A7A7A' + :readonly='SaveList[4]' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 开始时间 + </view> + <view class="value"> + <u--input v-model="formData.house_decoration_construction.startTime" color='#7A7A7A' + :readonly='SaveList[4]' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 修/建标准 + </view> + <view class="value"> + <u--input v-model="formData.house_decoration_construction.standard" color='#7A7A7A' + :readonly='SaveList[4]' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 事主要求 + </view> + <view class="value"> + <u--input v-model="formData.house_decoration_construction.ask" color='#7A7A7A' + :readonly='SaveList[4]' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 房屋建设时长 + </view> + <view class="value"> + <u--input v-model="formData.house_decoration_construction.time" color='#7A7A7A' + :readonly='SaveList[4]' border="none"></u--input> + </view> + </view> + <view class="item"> + <view class="lable"> + 设计服务 + </view> + <view class="value"> + <u--input v-model="formData.house_decoration_construction.serve" color='#7A7A7A' + :readonly='SaveList[4]' border="none"></u--input> + </view> + </view> + </view> + </view> + </view> + </view> + + <!-- content --> + <view class="login-btn" @click="submit" :class="{'login-btn-no':saveNum < 2 ?true:false}"> + 确认提交 + </view> + + <u-overlay :show="showOverly" @click="showOverly = false"> + <view class="warp"> + <view class="toast"> + <view class="toast-tit"> + {{showText.title}} + </view> + <view class="toast-conntent"> + {{showText.content}} + </view> + <view class="off"> + <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/496fd202401271436368155.png" + width="50rpx" height="50rpx" /> + </view> + </view> + </view> + </u-overlay> + </view> +</template> + +<script> + import { + HTTP_REQUEST_URL_SIX + } from "@/config/app.js" + export default { + data() { + return { + value: [], + showPicker: false, + showOverly: false, + isOpen: [true, true, true, true, true], + SaveList: [false, false, false, false, false], + domHeight: [], + columns: [ + ['是', '否'] + ], + mode: 'add', + formData: { + shop_user_id: 1, + name: "", + contact: "", + family_count: "", + address: "", + house_rent_info: { + area: "", + ageLimit: "", + request: "", + isFinish: "", + fitment: "" + }, + land_rent_info: { + isBreeding: "", + area: "", + request: "", + payInfo: "", + advantage: "", + shortcoming: "", + reson: "", + ageLimit: "", + }, + product_info: { + type: "", + area: "", + quality: "", + manner: "", + maturationCycle: "", + maturationTime: "", + yield: "", + sellType: "", + sellMethods: "", + Sales: "", + productName: "", + advantage: "", + isBrand: "", + isProcessing: "", + isDemands: "", + quesition: "" + }, + idle_asset_rent_info: { + area: "", + advantage: "", + num: "", + type: "", + other: "" + + }, + house_decoration_construction: { + area: "", + startTime: "", + standard: "", + ask: "", + time: "", + serve: "" + } + }, + showText: { + title: "", + content: "" + }, + textList: [{ + title: "房子出租需求", + content: "宅基地出租(通过展示自己长期不在老家居住的宅基地,平台匹配宅基地租给有需求的打造,实现与原有宅基地所有者合作达到闲置资产增收)" + }, + { + title: "空闲资产出租/出售需求", + content: "平台上提供(出租、出售、置换、抵押和捐赠等服务,让闲置资产价值最大化)" + }, + { + title: "农副产品出售需求", + content: "种养土地(收集土地上作物信息,平台展示、包装,助农销售增收)" + }, + { + title: "空闲资产出租/出售需求", + content: "房屋修缮及建设(提供房屋设计、修缮等服务)" + }, + { + title: "空闲土地出租需求", + content: "闲置土地(了解闲置土地面积,平台整合资源,帮助其匹配订单种养殖、出租、认养认等服务,让闲置土地增收)。" + }, + ] + + } + }, + computed: { + saveNum() { + return this.SaveList.filter(item => item === true).length; + }, + }, + onReady() { + for (let i = 1; i < 6; i++) { + this.domHeight[i - 1] = this.getFormHeight(`#formheight` + i) + } + }, + + onLoad() { + let user = this.$store.state.app.userInfo; + if (typeof user == 'string') user = JSON.parse(user); + this.formData.shop_user_id = user.uid; + uni.request({ + url: HTTP_REQUEST_URL_SIX + '/api/index/getVillagerInfo', //仅为示例,并非真实接口地址。 + method: 'GET', + data: { + shop_user_id: user.uid + }, + success: (res) => { + if (res.data.data.length != 0) { + this.mode = 'edit' + this.formData = res.data.data + this.formData.house_rent_info = JSON.parse(this.formData.house_rent_info) + this.formData.land_rent_info = JSON.parse(this.formData.land_rent_info) + this.formData.product_info = JSON.parse(this.formData.product_info) + this.formData.idle_asset_rent_info = JSON.parse(this.formData.idle_asset_rent_info) + this.formData.house_decoration_construction = JSON.parse(this.formData + .house_decoration_construction) + if (this.formData.house_rent_info.area) this.SaveList.splice(0, 1, true); + if (this.formData.land_rent_info.area) this.SaveList.splice(1, 1, true); + if (this.formData.product_info.area) this.SaveList.splice(2, 1, true); + if (this.formData.idle_asset_rent_info.area) this.SaveList.splice(3, 1, true); + if (this.formData.house_decoration_construction.area) this.SaveList.splice(4, 1, true); + console.log(this.SaveList, "salist") + console.log(this.saveNum, "num") + } + }, + fail: (err) => { + uni.showToast({ + icon: 'none', + title: err.msg || err.message || err + }) + } + }); + + + }, + methods: { + getFormHeight(dom) { + let height + const query = uni.createSelectorQuery().in(this); + query + .select(dom) + .boundingClientRect((data) => { + height = (data.height + 20) + }) + .exec() + return height + 'px' + + }, + back() { + uni.navigateBack(); + }, + showFn(i) { + this.showText = this.textList[i] + this.showOverly = true + }, + + + open(index) { + this.isOpen.forEach((item, i) => { + if (i == index) { + this.isOpen.splice(index, 1, this.isOpen[index] ? false : true); + } else { + this.isOpen.splice(i, 1, true); + } + }) + }, + + async submit() { + if (this.saveNum < 2) return + let that = this + uni.request({ + url: HTTP_REQUEST_URL_SIX + (that.mode == 'add' ? '/api/index/addVillagerInfo' : + '/api/index/editVillagerInfo'), + method: 'POST', + data: { + ...this.formData + }, + success: (res) => { + uni.showToast({ + icon: 'none', + title: '提交成功', + success: () => { + this.$u.sleep(1500).then(() => { + uni.switchTab({ + url: '/pages/index/index' + }) + }) + } + }) + }, + fail: (err) => { + uni.showToast({ + icon: 'none', + title: err.msg || err.message || err + }) + } + }); + }, + + sava(index, key) { + for (let keys in this.formData[key]) { + if (this.formData[key][keys] == '') { + this.$u.toast('请填写完整') + return + } + } + this.SaveList.splice(index, 1, true); + this.open(index) + }, + edit(index) { + this.SaveList.splice(index, 1, false); + }, + + } + } +</script> +<style lang="scss" scoped> + .box { + background: #F5F5F5; + min-height: 100vh; + font-size: 28rpx; + padding-bottom: 5vh; + } + + .bg { + width: 750rpx; + height: 660rpx; + background-image: url('https://lihai001.oss-cn-chengdu.aliyuncs.com/def/c7e26202402261051094476.webp'); + background-size: 100% 100%; + position: relative; + } + + .user-info { + width: 686rpx; + margin: 0 auto; + // height: 550rpx; + background-image: url('https://lihai001.oss-cn-chengdu.aliyuncs.com/def/549b3202401271438211224.png'); + background-size: 100% 100%; + position: absolute; + top: 370rpx; + left: 50%; + transform: translateX(-50%); + box-sizing: border-box; + padding: 36rpx 40rpx; + display: flex; + flex-direction: column; + justify-content: space-between; + + + box-shadow: 0rpx 3rpx 12rpx 1rpx #D6D6D6; + background: #FFFFFF; + box-shadow: 0rpx 3rpx 12rpx 1rpx #D6D6D6; + border-radius: 40rpx 40rpx 40rpx 40rpx; + + } + + .item { + display: flex; + align-items: center; + margin-bottom: 56rpx; + + &:nth-last-child(1) { + margin-bottom: 0; + } + + .lable { + font-weight: 600; + font-size: 26rpx; + color: #262626; + text-align: center; + white-space: nowrap; + } + + .value { + margin-left: 60rpx; + width: 400rpx; + // background-color: red; + } + } + + .tit { + display: flex; + width: 638rpx; + margin: 180rpx auto 30rpx; + justify-content: space-between; + font-size: 28rpx; + color: #2E2E2E; + font-weight: 600; + } + + .card { + width: 686rpx; + margin: 0 auto; + background-color: white; + padding: 30rpx; + border-radius: 20rpx; + position: relative; + + .card-tit { + display: flex; + justify-content: space-between; + } + + .finsh { + // background-color: red; + width: 190rpx; + text-align: center; + height: 90rpx; + position: absolute; + right: 30rpx; + top: 120rpx; + + .finsh-top { + height: 10rpx; + background-color: #F98144; + border-radius: 100rpx 100rpx 0 0; + } + + .finsh-cont { + height: 70rpx; + width: 162rpx; + margin: 0 auto; + background-color: #F98144; + font-size: 32rpx; + border-radius: 0rpx 0rpx 20rpx 20rpx; + line-height: 60rpx; + color: white; + + } + } + } + + .card-content { + border-radius: 20rpx; + padding: 20rpx; + overflow: hidden; + transition: 300ms; + width: 690rpx; + margin: 30rpx auto; + background: #DFF6E0; + + .form { + background-color: #fff; + padding: 20rpx; + border-radius: 20rpx; + margin-top: 20rpx; + } + + .form-tit { + font-size: 32rpx; + color: #20A162; + display: flex; + align-items: center; + display: flex; + justify-content: space-between; + + .submit { + width: 162rpx; + height: 58rpx; + line-height: 58rpx; + border-radius: 48rpx; + opacity: 1; + color: white; + text-align: center; + background: linear-gradient(158deg, #20A162 0%, #41B745 100%); + box-shadow: 0rpx 1rpx 2rpx 1rpx #127A19, inset 0rpx 3rpx 4rpx 1rpx #7CDF80; + } + + .edit-btn { + width: 132rpx; + height: 58rpx; + line-height: 58rpx; + border-radius: 48rpx; + color: #20A162 !important; + text-align: center; + box-shadow: 0rpx 1rpx 2rpx 1rpx #2B8131; + border: 1rpx solid #20A162; + background: transparent; + } + + .submit:active { + background-color: grey; + } + } + } + + .icon { + margin-left: 10rpx; + transform: translateY(2rpx); + transition: 300ms !important; + } + + .toast { + width: 588rpx; + height: 340rpx; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + background-image: url('https://lihai001.oss-cn-chengdu.aliyuncs.com/def/025fc202402261139275710.webp'); + background-size: 100% 100%; + + .toast-tit { + text-align: center; + font-size: 32rpx; + line-height: 45rpx; + color: white; + padding-top: 10rpx; + } + + .toast-conntent { + padding: 35rpx 50rpx; + text-indent: 2em; + font-size: 28rpx; + color: #7A7A7A; + line-height: 42rpx; + } + + .off { + position: absolute; + right: 40rpx; + top: -40rpx; + } + } + + .login-btn { + width: 690rpx; + height: 88rpx; + line-height: 88rpx; + background: linear-gradient(323deg, #52C973 0%, #20A162 100%); + border-radius: 44rpx; + color: #FFFFFF; + font-weight: 600; + font-size: 30rpx; + text-align: center; + margin: 0 auto; + } + + .login-btn-no { + background: transparent; + color: #ADADAD; + } + + .login-btn:active { + opacity: .9; + } + + .bg_back { + height: 34rpx; + width: 20rpx; + position: absolute; + top: calc(var(--status-bar-height) + 30rpx); + left: 30rpx; + z-index: 999; + } +</style> \ No newline at end of file diff --git a/pages/helpPeople/helpPeople.vue b/pages/helpPeople/helpPeople.vue index 836f6a4..bcebee6 100644 --- a/pages/helpPeople/helpPeople.vue +++ b/pages/helpPeople/helpPeople.vue @@ -3,17 +3,16 @@ <view class="box" style="position: relative;"> <image @click="back" class="bg_back" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/new_activity/back.png"></image> - <view class="li" @click="navSw('/pages/index/index')"> - <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/3b48a202402260945419661.webp" width="690rpx" - height="200rpx" style="position: absolute;"></u--image> + <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/edf53202401271436507555.png" width="690rpx" + height="200rpx" style="position: absolute;" /> <view class="btn"> 我是居民用户 </view> </view> <view class="li" style="margin-top: 50rpx;" @click="navgo('/pages/helpPeople/formTable')"> - <u-image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/48aed202402260946123969.webp" width="690rpx" - height="200rpx" style="position: absolute;"></u-image> + <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/8489c202401271437055619.png" width="690rpx" + height="200rpx" style="position: absolute;" /> <view class="btn"> 我是农民用户 </view> @@ -23,11 +22,6 @@ <script> export default { - data() { - return { - current: 0 - } - }, methods: { back() { uni.navigateBack(); @@ -47,21 +41,15 @@ </script> <style lang='scss' scoped> - page { - height: 100%; - overflow: hidden; - background-image: linear-gradient(180deg, #20A162 0%, #EFFAEF 39%, #EFFCEA 68%, #EFFFE5 100%); - } - .box { width: 750rpx; - height: 100vh; - background-image: url(https://lihai001.oss-cn-chengdu.aliyuncs.com/def/1333d202402261025145680.webp); - background-repeat: no-repeat; - background-size: 100% auto; + height: 1624rpx; + background-image: url('https://lihai001.oss-cn-chengdu.aliyuncs.com/def/9c4b4202401271437449183.png'); + background-size: 100% 100%; padding-top: 500rpx; } + .li { margin: 0rpx auto; width: 690rpx; @@ -76,13 +64,14 @@ height: 76rpx; border-radius: 40rpx 40rpx 40rpx 40rpx; opacity: 1; - border: 2rpx solid #20A162; + border: 2rpx solid #FF5E0C; text-align: center; line-height: 76rpx; - color: #20A162; + color: #FF5E0C; font-size: 34rpx; right: 50rpx; bottom: 50rpx; + } } diff --git a/pages/helpPeople/helpPeople_green.vue b/pages/helpPeople/helpPeople_green.vue new file mode 100644 index 0000000..836f6a4 --- /dev/null +++ b/pages/helpPeople/helpPeople_green.vue @@ -0,0 +1,96 @@ +<template> + + <view class="box" style="position: relative;"> + <image @click="back" class="bg_back" + src="https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/new_activity/back.png"></image> + + <view class="li" @click="navSw('/pages/index/index')"> + <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/3b48a202402260945419661.webp" width="690rpx" + height="200rpx" style="position: absolute;"></u--image> + <view class="btn"> + 我是居民用户 + </view> + </view> + <view class="li" style="margin-top: 50rpx;" @click="navgo('/pages/helpPeople/formTable')"> + <u-image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/48aed202402260946123969.webp" width="690rpx" + height="200rpx" style="position: absolute;"></u-image> + <view class="btn"> + 我是农民用户 + </view> + </view> + </view> +</template> + +<script> + export default { + data() { + return { + current: 0 + } + }, + methods: { + back() { + uni.navigateBack(); + }, + navgo(url) { + uni.navigateTo({ + url + }) + }, + navSw(url) { + uni.switchTab({ + url: url + }) + } + } + } +</script> + +<style lang='scss' scoped> + page { + height: 100%; + overflow: hidden; + background-image: linear-gradient(180deg, #20A162 0%, #EFFAEF 39%, #EFFCEA 68%, #EFFFE5 100%); + } + + .box { + width: 750rpx; + height: 100vh; + background-image: url(https://lihai001.oss-cn-chengdu.aliyuncs.com/def/1333d202402261025145680.webp); + background-repeat: no-repeat; + background-size: 100% auto; + padding-top: 500rpx; + } + + .li { + margin: 0rpx auto; + width: 690rpx; + height: 200rpx; + background-size: 100% 100%; + position: relative; + + .btn { + z-index: 999; + position: absolute; + width: 287rpx; + height: 76rpx; + border-radius: 40rpx 40rpx 40rpx 40rpx; + opacity: 1; + border: 2rpx solid #20A162; + text-align: center; + line-height: 76rpx; + color: #20A162; + font-size: 34rpx; + right: 50rpx; + bottom: 50rpx; + } + } + + .bg_back { + height: 34rpx; + width: 20rpx; + position: absolute; + top: calc(var(--status-bar-height) + 30rpx); + left: 30rpx; + } +</style> \ No newline at end of file diff --git a/pages/index/component/shopList.vue b/pages/index/component/shopList.vue index d75c30a..ecfaa10 100644 --- a/pages/index/component/shopList.vue +++ b/pages/index/component/shopList.vue @@ -6,29 +6,30 @@ </view> <view class="mer-box"> <block v-if="tabConfig == 0"> - <view class="mer-item" v-for="(item, index) in brandList" :key="index" :style="'border-radius:'+bgStyle+'rpx'"> - <view class="mer-hd" @click="goStore(item.mer_id)" :style="'border-radius:'+bgStyle+'rpx '+bgStyle+'rpx 0 0'"> + <view class="mer-item" v-for="(item, index) in brandList" :key="index" + :style="'border-radius:'+bgStyle+'rpx'"> + <view class="mer-hd" @click="goStore(item.mer_id)" + :style="'border-radius:'+bgStyle+'rpx '+bgStyle+'rpx 0 0'"> <image :src="item.mer_banner"></image> <view class="mer-name"> <image :src="item.mer_avatar"></image> <view class="txt line1">{{ item.mer_name }}</view> - <text v-if="item.type_name" class="store_type" :style="'background:'+themeColor">{{ item.type_name }}</text> - <text v-else-if="item.is_trader" class="store_type" :style="'background:'+themeColor">自营</text> + <text v-if="item.type_name" class="store_type" + :style="'background:'+themeColor">{{ item.type_name }}</text> + <text v-else-if="item.is_trader" class="store_type" + :style="'background:'+themeColor">自营</text> </view> </view> <view class="pro-box"> - <navigator - :url="`/pages/goods_details/index?id=${itemn.product_id}`" - hover-class="none" - class="pro-item" - v-for="(itemn, indexn) in item.all_recommend" - :key="indexn" - v-if="item.all_recommend.length <= 3" - > + <navigator :url="`/pages/goods_details/index?id=${itemn.product_id}`" hover-class="none" + class="pro-item" v-for="(itemn, indexn) in item.all_recommend" :key="indexn" + v-if="item.all_recommend.length <= 3"> <view class="picture"> <easy-loadimage mode="widthFix" :image-src="itemn.image"></easy-loadimage> - <view v-if="itemn.border_pic" :style="{ backgroundImage: `url(${itemn.border_pic})` }" class="border-picture"></view> - </view> + <view v-if="itemn.border_pic" + :style="{ backgroundImage: `url(${itemn.border_pic})` }" class="border-picture"> + </view> + </view> <view v-if="titleShow" class="name line1">{{itemn.store_name}}</view> <view v-if="priceShow" class="price" :style="'color:'+themeColor"> <text>¥</text> @@ -40,275 +41,318 @@ </block> <block v-else> <view class="mer_count"> - <view class="item" v-for="(item, index) in brandList" :key="index" @click="goStore(item.mer_id)"> + <view class="item" v-for="(item, index) in brandList" :key="index" + @click="goStore(item.mer_id)"> <image :src="item.mer_avatar" mode="widthFix"></image> </view> </view> - </block> + </block> <view class="more-shop" @click="moreShop"> <text>更多店铺</text> <text class="iconfont icon-xiangyou"></text> </view> </view> </view> - </view> + </view> </template> <script> -// +---------------------------------------------------------------------- -// | CRMEB [ CRMEB赋能开发者,助力企业发展 ] -// +---------------------------------------------------------------------- -// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved. -// +---------------------------------------------------------------------- -// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 -// +---------------------------------------------------------------------- -// | Author: CRMEB Team <admin@crmeb.com> -// +---------------------------------------------------------------------- -import easyLoadimage from '@/components/easy-loadimage/easy-loadimage.vue'; -import { storeList } from '@/api/api.js'; -import { mapGetters } from 'vuex'; -import { configMap } from '@/utils'; -export default { - computed: configMap(['hide_mer_status']), - components: { - easyLoadimage - }, - props: { - dataConfig: { - type: Object, - default: () => {} - } - }, - data() { - return { - brandList: [], - mbConfig: this.dataConfig.mbConfig.val*2, //页面间距 - prConfig: this.dataConfig.prConfig.val*2, //背景间距 - logoUrl: this.dataConfig.logoConfig.url, - bgStyle: this.dataConfig.bgStyle.type ? '16' : 0, - bgColor: this.dataConfig.bgColor.color[0].item, - themeColor: this.dataConfig.themeColor.color[0].item, - tabConfig: this.dataConfig.tabConfig.tabVal, //展示样式 - numConfig: this.dataConfig.numConfig.val, - titleShow: this.dataConfig.titleShow.val, - priceShow: this.dataConfig.priceShow.val, - diy_id: this.dataConfig.did, - unique: this.dataConfig.timestamp, - } - }, - created() {}, - mounted() { - this.storeMerchant(); - }, - methods: { - // 进店看看 - goStore(id) { - if (this.hide_mer_status != 1) { - uni.navigateTo({ - url: `/pages/store/home/index?id=${id}` - }); + // +---------------------------------------------------------------------- + // | CRMEB [ CRMEB赋能开发者,助力企业发展 ] + // +---------------------------------------------------------------------- + // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved. + // +---------------------------------------------------------------------- + // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 + // +---------------------------------------------------------------------- + // | Author: CRMEB Team <admin@crmeb.com> + // +---------------------------------------------------------------------- + import easyLoadimage from '@/components/easy-loadimage/easy-loadimage.vue'; + import { + storeList + } from '@/api/api.js'; + import { + mapGetters + } from 'vuex'; + import { + configMap + } from '@/utils'; + export default { + computed: configMap(['hide_mer_status']), + components: { + easyLoadimage + }, + props: { + dataConfig: { + type: Object, + default: () => {} } }, - // 更多店铺 - moreShop() { - uni.navigateTo({ - url: `/pages/store/shopStreet/index?cate_id=&type_id=` - }); + data() { + return { + brandList: [], + mbConfig: this.dataConfig.mbConfig.val * 2, //页面间距 + prConfig: this.dataConfig.prConfig.val * 2, //背景间距 + logoUrl: this.dataConfig.logoConfig.url, + bgStyle: this.dataConfig.bgStyle.type ? '16' : 0, + bgColor: this.dataConfig.bgColor.color[0].item, + themeColor: this.dataConfig.themeColor.color[0].item, + tabConfig: this.dataConfig.tabConfig.tabVal, //展示样式 + numConfig: this.dataConfig.numConfig.val, + titleShow: this.dataConfig.titleShow.val, + priceShow: this.dataConfig.priceShow.val, + diy_id: this.dataConfig.did, + unique: this.dataConfig.timestamp, + } }, - // 品牌好店 - storeMerchant() { - storeList({ - diy_id: this.diy_id, - unique: this.unique, - page: 1, - limit: this.numConfig ? this.numConfig : 4, - is_best: 1 - }).then(res => { - this.brandList = res.data.list; - }); + created() {}, + mounted() { + this.storeMerchant(); }, - } -}; + methods: { + // 进店看看 + goStore(id) { + if (this.hide_mer_status != 1) { + uni.navigateTo({ + url: `/pages/store/home/index?id=${id}` + }); + } + }, + // 更多店铺 + moreShop() { + uni.navigateTo({ + url: `/pages/store/shopStreet/index?cate_id=&type_id=` + }); + }, + // 品牌好店 + storeMerchant() { + storeList({ + diy_id: this.diy_id, + unique: this.unique, + page: 1, + limit: this.numConfig ? this.numConfig : 4, + is_best: 1 + }).then(res => { + this.brandList = res.data.list; + }); + }, + } + }; </script> <style scoped lang="scss"> -.explosion { - .common-hd { - display: flex; - align-items: center; - justify-content: center; - - .title-img{ - width: 242rpx; - margin: 20rpx 0; - } - } - .mer-box { - margin-bottom: 20rpx; - .mer-item { - margin-bottom: 20rpx; - background-color: #fff; - text-align: center; - .mer-hd { - position: relative; - width: 100%; - height: 200rpx; - border-radius: 16rpx 16rpx 0 0; - overflow: hidden; - image { - width: 100%; - height: 100%; - } - .mer-name { - position: absolute; - left: 20rpx; - top: 20rpx; - display: flex; - max-width: 60%; - padding: 8rpx 8rpx 8rpx 4rpx; - border-radius: 26rpx; - background: #fff; - font-weight: bold; - font-size: 12px; - align-items: center; - image { - width: 38rpx; - height: 38rpx; - margin-right: 10rpx; - border-radius: 50%; - } - .txt { - flex: 1; - line-height: 19px; - height: 19px; - } - .store_type { - font-size: 10px; - color: #fff; - background-color: #e93323; - padding: 0 5px; - line-height: 19px; - height: 19px; - margin-left: 20rpx; - border-radius: 30rpx; - } - } - } - /deep/.easy-loadimage,/deep/uni-image,image,/deep/.loadfail-img{ - width: 100%; - height: 214rpx; - } - .pro-box { - display: flex; - align-items: center; - padding: 20rpx 20rpx 30rpx; - .pro-item { - width: 31.3%; - margin-right: 3.05%; - .picture,/deep/.easy-loadimage,/deep/uni-image,/deep/image,/deep/.loadfail-img { - width: 100%; - height: 214rpx; - position: relative; - } - .sell_out { - display: flex; - width: 110rpx; - height: 110rpx; - align-items: center; - justify-content: center; - border-radius: 100%; - background: rgba(0,0,0,.6); - color: #fff; - font-size: 24rpx; - position: absolute; - top: 50%; - left: 50%; - margin: -55rpx 0 0 -55rpx; - &::before{ - content: ""; - display: block; - width: 100rpx; - height: 100rpx; - border-radius: 100%; - border: 1px dashed #fff; - position: absolute; - top: 5rpx; - left: 5rpx; - } - } - .border-picture { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: center/cover no-repeat; - } - .name{ - padding: 6rpx 9rpx; - margin-top: 6rpx; - } - .price { - margin-top: 5rpx; - font-size: 28rpx; - color: $theme-color; - font-weight: bold; - text { - font-size: 28rpx; - } - } - &:last-child { - margin-right: 0; - } - .picture { - position: relative; - } - .border-picture { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: center/cover no-repeat; - } - } - } - } - .more-shop { + .explosion { + .common-hd { display: flex; align-items: center; justify-content: center; - background-color: #ffffff; - padding: 27rpx 0; - color: #999999; - font-size: 26rpx; - .icon-xiangyou { - font-size: 22rpx; + + .title-img { + width: 242rpx; + margin: 20rpx 0; + } + } + + .mer-box { + margin-bottom: 20rpx; + + .mer-item { + margin-bottom: 20rpx; + background-color: #fff; + text-align: center; + + .mer-hd { + position: relative; + width: 100%; + height: 200rpx; + border-radius: 16rpx 16rpx 0 0; + overflow: hidden; + + image { + width: 100%; + height: 100%; + } + + .mer-name { + position: absolute; + left: 20rpx; + top: 20rpx; + display: flex; + max-width: 60%; + padding: 8rpx 8rpx 8rpx 4rpx; + border-radius: 26rpx; + background: #fff; + font-weight: bold; + font-size: 12px; + align-items: center; + + image { + width: 38rpx; + height: 38rpx; + margin-right: 10rpx; + border-radius: 50%; + } + + .txt { + flex: 1; + line-height: 19px; + height: 19px; + } + + .store_type { + font-size: 10px; + color: #fff; + background-color: #e93323; + padding: 0 5px; + line-height: 19px; + height: 19px; + margin-left: 20rpx; + border-radius: 30rpx; + } + } + } + + /deep/.easy-loadimage, + /deep/uni-image, + image, + /deep/.loadfail-img { + width: 100%; + height: 214rpx; + } + + .pro-box { + display: flex; + align-items: center; + padding: 20rpx 20rpx 30rpx; + + .pro-item { + width: 31.3%; + margin-right: 3.05%; + + .picture, + /deep/.easy-loadimage, + /deep/uni-image, + /deep/image, + /deep/.loadfail-img { + width: 100%; + height: 214rpx; + position: relative; + } + + .sell_out { + display: flex; + width: 110rpx; + height: 110rpx; + align-items: center; + justify-content: center; + border-radius: 100%; + background: rgba(0, 0, 0, .6); + color: #fff; + font-size: 24rpx; + position: absolute; + top: 50%; + left: 50%; + margin: -55rpx 0 0 -55rpx; + + &::before { + content: ""; + display: block; + width: 100rpx; + height: 100rpx; + border-radius: 100%; + border: 1px dashed #fff; + position: absolute; + top: 5rpx; + left: 5rpx; + } + } + + .border-picture { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: center/cover no-repeat; + } + + .name { + padding: 6rpx 9rpx; + margin-top: 6rpx; + } + + .price { + margin-top: 5rpx; + font-size: 28rpx; + color: $theme-color; + font-weight: bold; + + text { + font-size: 28rpx; + } + } + + &:last-child { + margin-right: 0; + } + + .picture { + position: relative; + } + + .border-picture { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: center/cover no-repeat; + } + } + } + } + + .more-shop { + display: flex; + align-items: center; + justify-content: center; + background-color: #ffffff; + padding: 27rpx 0; + color: #999999; + font-size: 26rpx; + + .icon-xiangyou { + font-size: 22rpx; + } } } } -} -.mer_count{ - display: flex; - flex-wrap: wrap; - padding: 20rpx; - align-items: center; - .item{ - flex: 4; - height: 140rpx; - margin: 0 2% 30rpx 0; - background: #FEFEFF; - border-radius: 16rpx; + + .mer_count { display: flex; + flex-wrap: wrap; + padding: 20rpx; align-items: center; - justify-content: center; - /deep/uni-image,/deep/image,/deep/.easy-loadimage{ - width: 100%!important; - max-height: 140rpx; - } - &:nth-child(4n){ - margin-right: 0; + + .item { + flex: 4; + height: 140rpx; + margin: 0 2% 30rpx 0; + background: #FEFEFF; + border-radius: 16rpx; + display: flex; + align-items: center; + justify-content: center; + + /deep/uni-image, + /deep/image, + /deep/.easy-loadimage { + width: 100% !important; + max-height: 140rpx; + } + + &:nth-child(4n) { + margin-right: 0; + } } } -} -</style> +</style> \ No newline at end of file diff --git a/pages/rich/mp4.vue b/pages/rich/mp4.vue new file mode 100644 index 0000000..cb3c1ea --- /dev/null +++ b/pages/rich/mp4.vue @@ -0,0 +1,124 @@ +<template> + <view class="box" style="position: relative;"> + <view style="height: 30rpx;"></view> + <view class=""> + <block v-for="(item, index) in list" :key="index"> + <view class="card"> + <view class="card-tit"> + <view class="" style="font-size: 32rpx;display: flex;align-items: center;"> + <view class=""> + {{item.title}} + </view> + </view> + <view class="" style="display: flex;align-items: center;" @click='open(index)'> + 展开 + <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/bceaf202401271439428345.png" width="24rpx" + height="24rpx" class='icon' :style=" {transform:isOpen[index]? 'rotate(180deg)' :'rotate(0)'} " /> + </view> + + </view> + </view> + <view class="card-content" :style="{height:isOpen[index]?'0':'auto',padding: isOpen[index]?'0':'20rpx' } " + style="height: 0;padding: 0;"> + <view id="formheight1"> + <view class="content" v-if="!isOpen[index]" v-html="item.content.content"></view> + </view> + </view> + </block> + <u-empty :show="list.length == 0" mode="list" text="没有找到数据呢" icon="http://cdn.uviewui.com/uview/empty/list.png"></u-empty> + </view> + </view> +</template> + +<script> + import { getArticleList } from "@/api/api.js" + export default { + data() { + return { + isOpen: [], + list: [], + } + }, + computed: {}, + onReady() {}, + onLoad() { + this.getArticleList(); + }, + methods: { + getArticleList() { + getArticleList(27).then(res => { + res.data.list.forEach(e => { + e.content.content = e.content.content.replace(/\<video /g, '<video style="width: 100%; background-color: #888888;" '); + this.isOpen.push(true); + }) + this.list = res.data.list; + }) + }, + open(index) { + this.isOpen.forEach((item, i) => { + if (i == index) { + this.isOpen.splice(index, 1, this.isOpen[index] ? false : true); + } else { + this.isOpen.splice(i, 1, true); + } + }) + }, + + } + } +</script> +<style lang="scss" scoped> + .box { + background: linear-gradient(to bottom, #FFF4DB, #FFEAC3); + min-height: 100vh; + font-size: 28rpx; + padding-bottom: 5vh; + } + + .tit { + display: flex; + width: 638rpx; + margin: 230rpx auto 30rpx; + justify-content: space-between; + font-size: 28rpx; + color: #000; + } + + .card { + width: 686rpx; + margin: 0 auto; + background-color: white; + padding: 30rpx; + border-radius: 20rpx; + position: relative; + + .card-tit { + display: flex; + justify-content: space-between; + } + + } + + .card-content { + background-color: #FFE7B9; + border-radius: 20rpx; + padding: 20rpx; + overflow: hidden; + transition: 300ms; + width: 690rpx; + margin: 18rpx auto; + + .content { + width: 100%; + height: auto; + overflow: hidden; + + } + } + + .icon { + margin-left: 10rpx; + transform: translateY(2rpx); + transition: 300ms !important; + } +</style> \ No newline at end of file diff --git a/pages/rich/rich.vue b/pages/rich/rich.vue new file mode 100644 index 0000000..dbb8644 --- /dev/null +++ b/pages/rich/rich.vue @@ -0,0 +1,129 @@ +<template> + <view class="box" style="position: relative;"> + <view style="height: 30rpx;"></view> + <view class=""> + <block v-for="(item, index) in list" :key="index"> + <view class="card"> + <view class="card-tit"> + <view class="" style="font-size: 32rpx;display: flex;align-items: center;"> + <view class=""> + {{item.title}} + </view> + </view> + <view class="" style="display: flex;align-items: center;" @click='open(index)'> + 展开 + <u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/bceaf202401271439428345.png" width="24rpx" + height="24rpx" class='icon' :style=" {transform:isOpen[index]? 'rotate(180deg)' :'rotate(0)'} " /> + </view> + + </view> + </view> + <view class="card-content" :style="{height:isOpen[index]?'0':'auto',padding: isOpen[index]?'0':'20rpx' } " + style="height: 0;padding: 0;"> + <view id="formheight1"> + <view class="content" v-if="!isOpen[index]" v-html="item.content.content"></view> + </view> + </view> + </block> + <u-empty :show="list.length == 0" mode="list" text="没有找到数据呢" icon="http://cdn.uviewui.com/uview/empty/list.png"></u-empty> + </view> + </view> +</template> + +<script> + import { getArticleList } from "@/api/api.js" + export default { + data() { + return { + isOpen: [], + list: [], + } + }, + computed: {}, + onReady() {}, + onLoad() { + let user = this.$store.state.app.userInfo; + if (typeof user == 'string') user = JSON.parse(user); + this.getArticleList(); + }, + methods: { + getArticleList() { + getArticleList(26).then(res => { + res.data.list.forEach(e => { + e.content.content = e.content.content.replace(/\<video /g, '<video style="width: 100%; background-color: #888888;" '); + this.isOpen.push(true); + }) + this.list = res.data.list; + }) + }, + back() { + uni.navigateBack(); + }, + open(index) { + this.isOpen.forEach((item, i) => { + if (i == index) { + this.isOpen.splice(index, 1, this.isOpen[index] ? false : true); + } else { + this.isOpen.splice(i, 1, true); + } + }) + }, + + } + } +</script> +<style lang="scss" scoped> + .box { + background: linear-gradient(to bottom, #FFF4DB, #FFEAC3); + min-height: 100vh; + font-size: 28rpx; + padding-bottom: 5vh; + } + + .tit { + display: flex; + width: 638rpx; + margin: 230rpx auto 30rpx; + justify-content: space-between; + font-size: 28rpx; + color: #000; + } + + .card { + width: 686rpx; + margin: 0 auto; + background-color: white; + padding: 30rpx; + border-radius: 20rpx; + position: relative; + + .card-tit { + display: flex; + justify-content: space-between; + } + + } + + .card-content { + background-color: #FFE7B9; + border-radius: 20rpx; + padding: 20rpx; + overflow: hidden; + transition: 300ms; + width: 690rpx; + margin: 18rpx auto; + + .content { + width: 100%; + height: auto; + overflow: hidden; + + } + } + + .icon { + margin-left: 10rpx; + transform: translateY(2rpx); + transition: 300ms !important; + } +</style> \ No newline at end of file diff --git a/pages/users/invite_code/index.vue b/pages/users/invite_code/index.vue index 737d0d8..ec0e47e 100644 --- a/pages/users/invite_code/index.vue +++ b/pages/users/invite_code/index.vue @@ -40,7 +40,7 @@ </view> <view v-if="list.length == 0"> - <emptyPage title="暂无邀请好友记录哦~"></emptyPage> + <emptyPage title="暂无邀请好友记录哦~" mt="60rpx" /> </view> </view> </view> @@ -67,7 +67,7 @@ loadTitle: '加载更多', isAuto: false, //没有授权的不会自动授权 isShowAuth: false, //是否隐藏授权 - uid:'' + uid: '' } }, onLoad() { @@ -81,7 +81,7 @@ onReachBottom: function() { this.getList(); }, - + methods: { // 获取二维码 getQrcode() { @@ -113,15 +113,15 @@ that.loadTitle = '加载更多'; }) }, - + getUserInfo() { let userInfo = this.$Cache.get("USER_INFO"); - if(userInfo){ + if (userInfo) { userInfo = JSON.parse(userInfo); this.uid = userInfo.uid; } }, - + handleSavePic() { // 获取要保存的图片路径或URL let imageUrl = this.qrcodeUrl; // 这里使用了网络上的图片作为示例 @@ -136,7 +136,7 @@ // #endif // #ifndef H5 - let that =this; + let that = this; uni.downloadFile({ url: imageUrl, success(res) { @@ -273,9 +273,9 @@ font-family: PingFang SC, PingFang SC; font-weight: 400; color: #2E2E2E; - white-space:nowrap; - overflow:hidden; - text-overflow:ellipsis; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } .red { diff --git a/pages/users/user_info/index.vue b/pages/users/user_info/index.vue index 6b7fbfe..3bc048e 100644 --- a/pages/users/user_info/index.vue +++ b/pages/users/user_info/index.vue @@ -4,20 +4,22 @@ <view class='personal-data'> <view class="wrapper" v-if="switchUserInfo.length>0"> <view class="title">管理我的账号</view> - <view class="wrapList" > + <view class="wrapList"> <view class="item acea-row row-between-wrapper" :class="item.uid === userInfo.uid ? 'on' : ''" - :style="{ 'background-image': `url(${item.uid == userInfo.uid ? domain+'/static/diy/currentAcc'+keyColor+'.png' : '' })` }" - v-for="(item,index) in switchUserInfo" - :key="index"> + :style="{ 'background-image': `url(${item.uid == userInfo.uid ? domain+'/static/diy/currentAcc'+keyColor+'.png' : '' })` }" + v-for="(item,index) in switchUserInfo" :key="index"> <view class="picTxt acea-row row-between-wrapper"> <block v-if='item.uid === userInfo.uid'> <view class="pictrue" v-if="!mp_is_new" @click="uploadpic"> <image :src="item.avatar || '/static/images/f.png'"></image> - <view v-if="open_update_info != 0" class="radius" ><span class="iconfont iconfonta icon-jilu-xuanzhong"></span></view> + <view v-if="open_update_info != 0" class="radius"><span + class="iconfont iconfonta icon-jilu-xuanzhong"></span></view> </view> - <button v-if="mp_is_new && open_update_info != 0" class="avatar-box pictrue" open-type="chooseAvatar" @chooseavatar="onChooseAvatar"> + <button v-if="mp_is_new && open_update_info != 0" class="avatar-box pictrue" + open-type="chooseAvatar" @chooseavatar="onChooseAvatar"> <image :src="item.avatar || '/static/images/f.png'"></image> - <view class="radius" ><span class="iconfont iconfonta icon-jilu-xuanzhong"></span></view> + <view class="radius"><span + class="iconfont iconfonta icon-jilu-xuanzhong"></span></view> </button> <button v-else-if="mp_is_new && open_update_info == 0" class="avatar-box"> <image :src="item.avatar || '/static/images/f.png'"></image> @@ -25,25 +27,28 @@ </block> <view class="pictrue" v-else> <image :src="item.avatar || '/static/images/f.png'"></image> - <view class="radius" v-if="open_update_info != 0"><span class="iconfont iconfonta icon-jilu-xuanzhong"></span></view> + <view class="radius" v-if="open_update_info != 0"><span + class="iconfont iconfonta icon-jilu-xuanzhong"></span></view> </view> <view class="text"> <view class="name line1">{{ item.nickname }}</view> </view> - </view> - <view class="currentBnt acea-row row-center-wrapper t-color" v-if='item.uid === userInfo.uid'> + </view> + <view class="currentBnt acea-row row-center-wrapper t-color" + v-if='item.uid === userInfo.uid'> 当前账号 </view> - <view class="bnt t-color acea-row row-center-wrapper" @click='switchAccounts(item,index)' v-else> + <view class="bnt t-color acea-row row-center-wrapper" @click='switchAccounts(item,index)' + v-else> 使用账号 </view> </view> </view> </view> <view class="list" v-else> - <view class='item acea-row row-between-wrapper' > + <view class='item acea-row row-between-wrapper'> <view>头像</view> - <view class="pictrue" v-if="!mp_is_new" @click="uploadpic"> + <view class="pictrue" v-if="!mp_is_new" @click="uploadpic"> <image class="avatar" :src="userInfo.avatar || '/static/images/f.png'"></image> </view> <button v-else class="avatar-box" open-type="chooseAvatar" @chooseavatar="onChooseAvatar"> @@ -69,10 +74,12 @@ </view> <view class='item acea-row row-between-wrapper'> <view>手机号码</view> - <navigator url="/pages/users/user_phone/index" hover-class="none" class="input" v-if="!userInfo.phone"> + <navigator url="/pages/users/user_phone/index" hover-class="none" class="input" + v-if="!userInfo.phone"> 点击绑定手机号<text class="iconfont icon-xiangyou"></text> </navigator> - <navigator url="/pages/users/user_modify_phone/index" hover-class="none" class='input acea-row row-between-wrapper' v-else> + <navigator url="/pages/users/user_modify_phone/index" hover-class="none" + class='input acea-row row-between-wrapper' v-else> <text class='id'>{{userInfo.phone}}</text> <text class='iconfont icon-you'></text> </navigator> @@ -84,23 +91,42 @@ <text class='iconfont icon-you'></text> </view> </view> + <view class='item acea-row row-between-wrapper'> + <view>填写邀请码</view> + <view class='input acea-row row-between-wrapper' @click="showPopup"> + <input type='text' placeholder="填写他人邀请码" v-model="promotion_code" disabled='true' + class='id'></input> + <text class='iconfont icon-you'></text> + </view> + <uni-popup ref="popup"> + <view class="code-popup"> + <text class="title">填写邀请码</text> + <u-input type='text' placeholder="填写他人邀请码" v-model="promotion_code" border="surround" + class='id'></u-input> + <u-button class="code-btn" @click="submitCode">确认</u-button> + </view> + </uni-popup> + </view> <view class='item acea-row row-between-wrapper'> <view>地址管理</view> - <navigator url="/pages/users/user_address_list/index" hover-class="none" class='input acea-row row-between-wrapper'> + <navigator url="/pages/users/user_address_list/index" hover-class="none" + class='input acea-row row-between-wrapper'> <text class='id'>立即前往</text> <text class='iconfont icon-you'></text> </navigator> </view> <view class='item acea-row row-between-wrapper'> <view>发票管理</view> - <navigator url="/pages/users/user_invoice_list/index" hover-class="none" class='input acea-row row-between-wrapper'> + <navigator url="/pages/users/user_invoice_list/index" hover-class="none" + class='input acea-row row-between-wrapper'> <text class='id'>立即前往</text> <text class='iconfont icon-you'></text> </navigator> </view> <view class='item acea-row row-between-wrapper'> <view>详细信息</view> - <navigator url="/pages/users/user_info_form/index" hover-class="none" class='input acea-row row-between-wrapper'> + <navigator url="/pages/users/user_info_form/index" hover-class="none" + class='input acea-row row-between-wrapper'> <text class='id'>立即前往</text> <text class='iconfont icon-you'></text> </navigator> @@ -112,21 +138,24 @@ <text class='iconfont icon-you'></text> </view> </view> + <!--#ifdef APP-PLUS--> - <view class='item acea-row row-between-wrapper'> + <view class='item acea-row row-between-wrapper' @click="$u.throttle(getVerion, 1500)"> <view>当前版本</view> <view class='input acea-row row-between-wrapper'> <input type='text' :value='version' disabled='true' class='id'></input> + <text class='iconfont icon-you'></text> </view> </view> <!--#endif--> </view> <!-- #ifdef H5 --> - <view class="logOut acea-row row-center-wrapper" @click="outLogin" v-if="!this.$wechat.isWeixin()">退出登录</view> + <view class="logOut acea-row row-center-wrapper" @click="outLogin" v-if="!this.$wechat.isWeixin()">退出登录 + </view> <!-- #endif --> <!-- #ifdef MP || APP-PLUS --> <view class="logOut acea-row row-center-wrapper" @click="outLogin">退出登录</view> - <!-- #endif --> + <!-- #endif --> <view class="foot-bar"></view> </view> </form> @@ -148,19 +177,32 @@ getLogout, userAcc, editAvatar, - updateInfo + updateInfo, + bindPromotionCode } from '@/api/user.js'; - import { switchH5Login, getAppVersion } from '@/api/api.js'; - import { mapGetters } from "vuex"; - import { configMap } from '@/utils'; + import { + switchH5Login, + getAppVersion + } from '@/api/api.js'; + import { + mapGetters + } from "vuex"; + import { + configMap + } from '@/utils'; import dayjs from "@/plugin/dayjs/dayjs.min.js"; import Cache from '@/utils/cache'; - import { HTTP_REQUEST_URL } from '@/config/app'; - import { toLogin } from '@/libs/login.js'; + import { + HTTP_REQUEST_URL + } from '@/config/app'; + import { + toLogin + } from '@/libs/login.js'; export default { components: {}, data() { return { + promotion_code: '', //邀请码 domain: HTTP_REQUEST_URL, userInfo: {}, loginType: 'h5', @@ -171,7 +213,9 @@ version: '' }; }, - computed: configMap({open_update_info: 0} ,mapGetters(['isLogin','viewColor','keyColor'])), + computed: configMap({ + open_update_info: 0 + }, mapGetters(['isLogin', 'viewColor', 'keyColor'])), onLoad() { if (this.isLogin) { this.getUserInfo(); @@ -182,7 +226,7 @@ this.appVersionConfig() //#endif }, - methods: { + methods: { toggle(type) { this.type = type // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 @@ -194,7 +238,7 @@ */ uploadpic: function() { let that = this; - if(that.open_update_info == 0){ + if (that.open_update_info == 0) { return; } that.$util.uploadImageOne('upload/image', function(res) { @@ -203,30 +247,36 @@ userInfo.avatar = res.data.path; } that.switchUserInfo[that.userIndex] = userInfo; - editAvatar({avatar:res.data.path}).then((res)=>{ + editAvatar({ + avatar: res.data.path + }).then((res) => { that.$util.Tips({ - title:res.message, + title: res.message, }) - }) - }); - }, + }) + }); + }, // 修改昵称 - changeInput(){ - if(this.open_update_info == 0){ + changeInput() { + if (this.open_update_info == 0) { return; } uni.navigateTo({ url: '/pages/users/user_nickname/index', }) - }, + }, // 微信头像获取 onChooseAvatar(e) { - const {avatarUrl} = e.detail + const { + avatarUrl + } = e.detail this.$util.uploadImgs('upload/image', avatarUrl, (res) => { this.userInfo.avatar = res.data.path - editAvatar({avatar:res.data.path}).then((res)=>{ + editAvatar({ + avatar: res.data.path + }).then((res) => { that.$util.Tips({ - title:res.message, + title: res.message, }) }) }, (err) => { @@ -236,17 +286,17 @@ // #ifdef APP-PLUS appVersionConfig() { let that = this; - console.log('app:'+plus.runtime.appid) + console.log('app:' + plus.runtime.appid) plus.runtime.getProperty(plus.runtime.appid, (info) => { this.version = info.version; - console.log('当前版本:'+ info.version) - }); + console.log('当前版本:' + info.version) + }); }, //#endif switchAccounts: function(item, index) { let userInfo = this.switchUserInfo[index], that = this; - + that.userIndex = index; if (that.switchUserInfo.length <= 1) return true; if (userInfo === undefined) return that.$util.Tips({ @@ -281,7 +331,7 @@ * */ outLogin: function() { - let that = this; + let that = this; if (that.loginType == 'h5') { uni.showModal({ title: '提示', @@ -319,29 +369,33 @@ switchUserInfo[i].user_type != "h5" && switchUserInfo[i].phone === "" ) - switchUserInfo.splice(i, 1); + switchUserInfo.splice(i, 1); //#endif } that.$set(that, "switchUserInfo", switchUserInfo); }) }, /**修改密码*/ - changePwd(){ + changePwd() { let that = this; - if(that.userInfo.phone){ + if (that.userInfo.phone) { uni.navigateTo({ url: `/pages/users/user_modify_pwd/index` }) - }else{ + } else { that.$util.Tips({ title: '请先绑定手机号' }); } }, + showPopup() { + if (this.promotion_code) return Toast('已经填写过了'); + this.$refs.popup.open(); + }, //注销账号 - changeCancel(){ + changeCancel() { uni.navigateTo({ - url: '/pages/users/user_about/index?from='+'the_cancellation_msg' + url: '/pages/users/user_about/index?from=' + 'the_cancellation_msg' }) }, /** @@ -351,20 +405,44 @@ let that = this; getUserInfo().then(res => { that.$set(that, 'userInfo', res.data); - if(res.data.phone){ + this.promotion_code = this.userInfo.promotion_code; + if (res.data.phone) { that.userAcc(); } }); + }, + + /** + * 获取版本信息 + */ + getVerion() { + this.$store.dispatch('INIT_CONFIG', true); + }, + + // 填写邀请码 + submitCode() { + if (!this.promotion_code) return; + bindPromotionCode({ + promotion_code: this.promotion_code + }).then(res => { + this.$refs.popup.close(); + this.$nextTick(() => { + Toast('修改成功'); + }) + }).catch(err => { + console.log(err); + }) } } } </script> <style scoped lang="scss"> - html{ - -webkit-text-size-adjust:none; + html { + -webkit-text-size-adjust: none; } - .radius{ + + .radius { background-color: white; width: 35rpx; height: 35rpx; @@ -376,45 +454,54 @@ right: 0; bottom: 0; } - .iconfonta{ + + .iconfonta { border-radius: 50%; font-size: 20rpx; color: red; } + .avatar { width: 120rpx; height: 120rpx; border-radius: 50%; } - .btnb{ + + .btnb { border-radius: 0; height: 100rpx; line-height: 100rpx; } - .btna{ + + .btna { height: 100rpx; line-height: 100rpx; border-radius: 10rpx 10rpx 0 0; } - .btnc{ + + .btnc { height: 130rpx; line-height: 130rpx; border-radius: 0; } + .personal-data { padding-bottom: calc(0rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/ padding-bottom: calc(0rpx + env(safe-area-inset-bottom)); ///兼容 IOS<11.2/ } + .personal-data .wrapper { margin: 10rpx 0; background-color: #fff; padding: 36rpx 30rpx 13rpx 30rpx; } + .personal-data .wrapper .title { margin-bottom: 30rpx; font-size: 32rpx; color: #282828; } + .personal-data .wrapper .wrapList .item { width: 690rpx; height: 160rpx; @@ -426,9 +513,11 @@ border: 2rpx solid #f8f8f8; box-sizing: border-box; } + .t-color { color: var(--view-theme); } + .personal-data .wrapper .wrapList .item.on { border-color: var(--view-theme); border-radius: 20rpx; @@ -436,32 +525,39 @@ background-color: var(--view-minorColor); background-repeat: no-repeat; } + .personal-data .wrapper .wrapList .item .picTxt { width: 445rpx; } + .personal-data .wrapper .wrapList .item .picTxt .pictrue { width: 96rpx; height: 96rpx; position: relative; } + .personal-data .wrapper .wrapList .item .picTxt .pictrue image { width: 100%; height: 100%; border-radius: 50%; } + .personal-data .wrapper .wrapList .item .picTxt .text { width: 325rpx; } + .personal-data .wrapper .wrapList .item .picTxt .text .name { width: 100%; font-size: 30rpx; color: #282828; } + .personal-data .wrapper .wrapList .item .picTxt .text .phone { font-size: 24rpx; color: #999; margin-top: 10rpx; } + .personal-data .wrapper .wrapList .item .bnt { font-size: 24rpx; background-color: #fff; @@ -470,6 +566,7 @@ height: 54rpx; border: 2rpx solid var(--view-theme); } + .personal-data .wrapper .wrapList .item .currentBnt { position: absolute; right: 0; @@ -480,10 +577,12 @@ height: 48rpx; border-radius: 0 20rpx 0 20rpx; } + .personal-data .list { margin-top: 15rpx; background-color: #fff; } + .personal-data .list .item { padding-right: 30rpx; height: 110rpx; @@ -492,6 +591,7 @@ font-size: 32rpx; color: #282828; } + .personal-data .list .item .phone { width: 160rpx; height: 56rpx; @@ -500,26 +600,32 @@ line-height: 56rpx; border-radius: 32rpx } + .personal-data .list .item .pictrue { width: 88rpx; height: 88rpx; } + .personal-data .list .item .pictrue image { width: 100%; height: 100%; border-radius: 50%; } + .personal-data .list .item .input { min-width: 415rpx; text-align: right; color: #868686; } + .personal-data .list .item .input .id { width: 365rpx; } + .personal-data .list .item .input .iconfont { font-size: 35rpx; } + .personal-data .modifyBnt { font-size: 32rpx; color: #fff; @@ -531,6 +637,7 @@ margin: 76rpx auto 0 auto; background: var(--view-theme); } + .personal-data .logOut { font-size: 32rpx; text-align: center; @@ -542,14 +649,55 @@ background-color: #ffffff; border: 1px solid var(--view-theme); } + .avatar-box { width: 96rpx; height: 96rpx; background: transparent; + image { width: 100%; height: 100%; border-radius: 50%; } } -</style> + + .personal-data .list .item .input { + min-width: 415rpx; + text-align: right; + color: #868686; + } + + .personal-data .list .item .input .id { + width: 365rpx; + } + + .personal-data .list .item .input .iconfont { + font-size: 35rpx; + } + + .code-popup { + width: 600rpx; + height: 300rpx; + background-color: #fff; + border-radius: 28rpx; + padding: 28rpx; + display: flex; + flex-direction: column; + justify-content: space-between; + + /deep/.u-border { + border-color: transparent !important; + } + + .title { + text-align: center; + } + + .code-btn { + background-color: $theme-color; + border-radius: 40rpx; + color: #fff; + } + } +</style> \ No newline at end of file