Browse Source

2022-1-20

cmy 3 năm trước cách đây
mục cha
commit
9cfc200056

+ 10 - 0
api/index.js

@@ -34,3 +34,13 @@ export function loadIndexs(data) {
 	});
 }
 
+// 获取文章热门列表
+export function hotList(data) {
+	return request({
+		url: '/api/article/hot/list',
+		method: 'get',
+		data
+	});
+}
+
+

+ 1 - 1
manifest.json

@@ -74,7 +74,7 @@
         "devServer" : {
             "proxy" : {
                 "/api" : {
-                    "target" : "https://dlzx.liuniu946.com/api",
+                    "target" : "http://zy.frp.liuniu946.com/api",
                     // "changeOrigin": true,
                     "pathRewrite" : {
                         "/api" : "" // rewrite path

+ 13 - 12
pages.json

@@ -27,7 +27,7 @@
 		{
 			"path": "pages/index/artList",
 			"style": {
-				"navigationBarTitleText": "列表",
+				"navigationBarTitleText": "公司简介",
 				"app-plus": {
 					"titleNView": {
 						"type": "transparent"
@@ -36,6 +36,17 @@
 			}
 			
 		},
+		{
+			"path": "pages/index/artDetail",
+			"style": {
+				"navigationBarTitleText": "文章详情",
+				"app-plus": {
+					"titleNView": {
+						"type": "transparent"
+					}
+				}
+			}
+		},
 		{
 			"path": "pages/category/category",
 			"style": {
@@ -431,17 +442,7 @@
 			"style": {
 				"navigationBarTitleText": "邀请好友"
 			}
-		}
-	 
-        ,{
-            "path" : "pages/index/recommend",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "",
-                "enablePullDownRefresh": false
-            }
-            
-        }
+		}
         ,{
             "path" : "pages/index/jifenShop",
             "style" :                                                                                    

+ 42 - 0
pages/index/artDetail.vue

@@ -0,0 +1,42 @@
+<template>
+	<view class="contet">
+		<view class="" v-html="content">
+			
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		loadIndexs,
+		getArticleList,
+		getArtDetai
+	} from '@/api/index.js';
+	export default {
+		data() {
+			return {
+				content: '',
+				id: 0,
+			}
+		},
+		onLoad(opt) {
+			this.id = opt.id
+			this.getDetai()
+		},
+		methods: {
+			getDetai() {
+				let obj = this
+				getArtDetai({},obj.id).then(res => {
+					console.log(res)
+					obj.content = res.data.content
+					if(obj.content != null){
+						obj.content = obj.content.replace(/<img/g,"<img style='max-width:100%;height:auto;min-width:100%;'");
+					}//小程序商品详情图超出屏幕问题
+				})
+			}
+		}
+	}
+</script>
+
+<style>
+</style>

+ 31 - 80
pages/index/index.vue

@@ -54,17 +54,17 @@
 				<image src="/static/icon/in7.png" @click="nav('/pages/index/vip')"></image>
 				<view class="cate-font">会员中心</view>
 			</view>
-			<view class="cate-item" @click="showPopup()">
+			<view class="cate-item" @click="nav('/pages/index/jifenShop')">
 				<image src="/static/icon/in8.png"></image>
 				<view class="cate-font">分享有礼</view>
 			</view>
 
 		</view>
-		<view class="jj-tit">
+		<view class="jj-tit" >
 			<view class="left">
 				<image src="../../static/icon/gsjj.png" mode="" class="jj-log"></image>
 				<view class="jj-title">
-					公司简介
+					公司文化
 				</view>
 			</view>
 			<view class="right" @click="nav('/pages/index/artList?cid=1')">
@@ -74,15 +74,15 @@
 				<image src="../../static/img/img39.png" mode="" class="jj-more"></image>
 			</view>
 		</view>
-		<view class="jj-wrap" >
-			<view class="jj" v-for="gs in 2" @click="nav('/pages/index/artDetail?id=' + gs.id)">
-				<image src="" mode="" class="jj-img"></image>
+		<view class="jj-wrap">
+			<view class="jj" v-for="ls in hostList" @click="nav('/pages/index/artDetail?id=' + ls.id)">
+				<image :src="ls.image_input[0]" mode="" class="jj-img"></image>
 				<view class="jj-info">
 					<view class="jj-tit-tit clamp">
-						标题
+						{{ls.title}}
 					</view>
 					<view class="jj-val clamp2">
-						更新时间:11111111
+						更新时间:{{ls.add_time}}
 					</view>
 				</view>
 			</view>
@@ -115,32 +115,13 @@
 				</view>
 			</view>
 		</view>
-		<uni-popup ref="popup" type="center">
-			<view class="popup">
-				<view class="popup-dox">
-					<image class="popup-logo" src="../../static/img/img009.png"></image>
-					<view class="pop-title">已为您定制专属客服</view>
-					<view>{{ weixin }}</view>
-					<image class="popup-text" @longtap="bc_code" :src="erweima"></image>
-					<view class="btn" @click="copy(weixin)">复制微信号</view>
-					<view class="pop-tip flex">
-						<view class="weixin">
-							<image src="../../static/img/weixin.png" mode=""></image>
-						</view>
-						<view>长按保存二维码</view>
-					</view>
-				</view>
-			</view>
-			<view class="close_icon" @click="close">
-				<image src="../../static/img/Close.png"></image>
-			</view>
-		</uni-popup>
 	</view>
 </template>
 
 <script>
 	import {
-		loadIndexs
+		loadIndexs,
+		hotList
 	} from '@/api/index.js';
 	import {
 		mapState
@@ -166,9 +147,8 @@
 				carouselList: [], //轮播图
 				swiperCurrent: 0,
 				dataList: [],
-				erweima: '',
-				weixin: '', //客服微信
-				swiperLength: 1 //图片数量
+				swiperLength: 1 ,//图片数量
+				hostList:[],//热门文章列表
 			};
 		},
 		onLoad: function(option) {
@@ -197,6 +177,8 @@
 				weixinObj.hideAllNonBaseMenuItem();
 			}
 			//#endif
+			// 获取热门文章页
+			this.hotList();
 		},
 		computed: {
 			...mapState('user', ['userInfo', 'orderInfo', 'hasLogin']),
@@ -239,6 +221,15 @@
 		},
 		// #endif
 		methods: {
+			// 获取热门文章
+			hotList(){
+				hotList().then((e) => {
+					this.hostList = e.data;
+					console.log(e);
+				}).catch((e) => {
+					console.log(e);
+				})
+			},
 			// #ifdef H5
 			IndexShare() {
 				let obj = this;
@@ -275,59 +266,19 @@
 			nav(url) {
 				uni.navigateTo({
 					url,
-					fail: () => {
-						console.log(1);
+					fail: (e) => {
+						console.log(e);
 						uni.switchTab({
 							url
 						});
 					}
 				});
 			},
-			showPopup() {
-				this.$refs.popup.open();
-			},
-			close() {
-				this.$refs.popup.close();
-			},
 			//轮播图切换修改背景色
 			swiperChange(e) {
 				const index = e.detail.current;
 				this.swiperCurrent = index;
 			},
-			copy(content) {
-				/**
-				 * 小程序端 和 app端的复制逻辑
-				 */
-				//#ifndef H5
-				uni.setClipboardData({
-					data: content,
-					success: function() {
-						console.log('success');
-						return true;
-					}
-				});
-				//#endif
-
-				/**
-				 * H5端的复制逻辑
-				 */
-				// #ifdef H5
-				if (!document.queryCommandSupported('copy')) {
-					//为了兼容有些浏览器 queryCommandSupported 的判断
-					// 不支持
-					return false;
-				}
-				let textarea = document.createElement('textarea');
-				textarea.value = content;
-				textarea.readOnly = 'readOnly';
-				document.body.appendChild(textarea);
-				textarea.select(); // 选择对象
-				textarea.setSelectionRange(0, content.length); //核心
-				let result = document.execCommand('copy'); // 执行浏览器复制命令
-				textarea.remove();
-				return result;
-				// #endif
-			},
 			comfirm(text) {
 				console.log(text);
 				const result = this.uniCopy(text);
@@ -380,12 +331,12 @@
 					.catch(e => {
 						uni.stopPullDownRefresh();
 					});
-				service({}).then(({
-					data
-				}) => {
-					this.erweima = data.service_qr;
-					this.weixin = data.service_wechat;
-				});
+				// service({}).then(({
+				// 	data
+				// }) => {
+				// 	this.erweima = data.service_qr;
+				// 	this.weixin = data.service_wechat;
+				// });
 			},
 			//详情页
 			navToDetailPage(item) {

+ 4 - 1
pages/money/pay.vue

@@ -57,7 +57,8 @@ export default {
 			// #ifdef H5
 			froms: '', //保存h5中数据来源对象
 			// #endif
-			pinkid: '' //保存拼团商品id
+			pinkid: '' ,//保存拼团商品id
+			goodsUpLevel:0//保存是否vip商品
 		};
 	},
 	computed: {
@@ -66,6 +67,7 @@ export default {
 		// #endif
 	},
 	onLoad(options) {
+		this.goodsUpLevel = options.goodsUpLevel;
 		if (options.type == 1) {
 			this.type = 1;
 			this.orderId = options.ordid;
@@ -233,6 +235,7 @@ export default {
 				useIntegral: prepage.checkedPoints ? 1 : 0, //是否积分抵扣1为是0为否
 				payType: obj.payName, //支付类型  weixin-微信 yue-余额
 				mark: prepage.desc, //备注
+				can_up_level:obj.goodsUpLevel,//类型
 				// #ifdef H5
 				from: obj.froms ? 'weixin' : 'H5', //来源
 				// #endif

+ 5 - 2
pages/order/createOrder.vue

@@ -176,10 +176,13 @@ export default {
 			integralMoney: 0, //积分抵扣金额
 			integralShow: false, //是否显示积分抵扣金额
 			payType: true, //是否可支付
-			pinkid: '' //保存拼团商品id
+			pinkid: '' ,//保存拼团商品id
+			goodsUpLevel:0,//保存默认是否为升级商品
 		};
 	},
 	onLoad(option) {
+		// 获取当前是否为vip商品
+		this.goodsUpLevel = option.goodsUpLevel;
 		// 判断是否为拼团商品
 		if (option.type == 'pink') {
 			this.pinkid = option.pinkId;
@@ -308,7 +311,7 @@ export default {
 				this.$api.msg('请选择收货地址');
 				return false;
 			}
-			let url =  '/pages/money/pay?key='+ this.orderKey
+			let url =  '/pages/money/pay?key='+ this.orderKey+'&goodsUpLevel='+this.goodsUpLevel;
 			if(this.pinkid){
 				url += '&pinkid='+this.pinkid
 			}

+ 1 - 1
pages/order/order.vue

@@ -190,7 +190,7 @@ export default {
 		// 订单支付
 		orderPay(e) {
 			uni.navigateTo({
-				url: '/pages/money/pay?type=1&ordid=' + e.order_id + '&money=' + e.pay_price
+				url: '/pages/money/pay?type=1&ordid=' + e.order_id + '&money=' + e.pay_price+'&goodsUpLevel='+e.can_up_level
 			});
 		},
 		//获取订单列表

+ 10 - 2
pages/product/product.vue

@@ -165,6 +165,8 @@
 					<view class="right">
 						<view class="good-name clamp">{{ goodsObjact.store_name }}</view>
 						<text class="price">¥{{ actionPrice }}</text>
+						<br/>
+						<text class="stock" v-if="goodsObjact.can_up_level==1">等级:{{levelName}}</text>
 						<!-- <text class="stock">库存:{{ goodsObjact.stock }}件</text> -->
 						<!-- <view class="selected" v-if="goodsType == 0">
 							已选:
@@ -186,7 +188,7 @@
 						</text>
 					</view>
 				</view>
-				<view class="attr-list">
+				<view class="attr-list" v-if="goodsObjact.can_up_level!=1">
 					<text>购买数量</text>
 					<view class="item-list">
 						<uni-number-box class="step" :isMin="true" :value="goodsNumber" :min="1" :max="goodsNumberMax" @eventChange="numberChange"></uni-number-box>
@@ -242,6 +244,7 @@ export default {
 			// 对比对象
 			productValue: [],
 			actionPrice: 0, //默认选中商品价格
+			levelName:'',//当前选中的等级
 			actionImage: '', //默认选中图片
 			uniqueId: '', //选中的商品分类
 			specSelected: [], //选中的分类
@@ -381,6 +384,7 @@ export default {
 				// 设置默认值
 				obj.actionImage = obj.productValue[str].image;
 				obj.uniqueId = obj.productValue[str].unique;
+				obj.levelName = obj.productValue[str].level_name;;//保存默认等级名称
 				// #ifdef H5
 				obj.shareDate();
 				// #endif
@@ -410,6 +414,8 @@ export default {
 			}
 		},
 		// #endif
+		
+		
 		// 购买数量变化
 		numberChange(e) {
 			this.goodsNumber = e.number;
@@ -439,6 +445,7 @@ export default {
 			if (this.productValue[str]) {
 				let data = this.productValue[str];
 				this.actionPrice = data.price;
+				this.levelName =  data.level_name;
 				this.goodsNumberMax = data.stock;
 				this.actionImage = data.image;
 				this.uniqueId = data.unique;
@@ -508,9 +515,10 @@ export default {
 			cartAdd(data)
 				.then(function({ data }) {
 					if (obj.type == 1) {
+						let url = '/pages/order/createOrder?id=' + data.cartId + '&goodsType=' + obj.goodsType+'&goodsUpLevel='+obj.goodsObjact.can_up_level;
 						// 跳转到支付页
 						uni.navigateTo({
-							url: '/pages/order/createOrder?id=' + data.cartId + '&goodsType=' + obj.goodsType
+							url
 						});
 					}
 					if (obj.type == 2) {

+ 1 - 0
pages/user/team.vue

@@ -123,6 +123,7 @@ export default {
 						navItem.orderList = navItem.orderList.concat(data.list);
 						navItem.page++;
 					}
+					
 					this.$nextTick(function() {
 						if (navItem.limit == data.list.length) {
 							//判断是否还有数据, 有改为 more, 没有改为noMore

+ 8 - 8
pages/user/user.vue

@@ -68,21 +68,21 @@
 			<view>
 				<view class="item-box item-box-a">
 					<view class="order-section">
-						<view class="order-item" @click="navTo('/pages/money/wallet')" hover-class="common-hover" :hover-stay-time="50">
+						<view class="order-item" @click="navTo('/pages/money/award')" hover-class="common-hover" :hover-stay-time="50">
 							<view class="icon icon-b"><image class="icon-img" src="/static/user/yue.png" mode="aspectFit"></image></view>
-							<view class="order-font">收益中心</view>
+							<view class="order-font">我的余额</view>
 						</view>
-						<view class="order-item" @click="navTo('/pages/user/award')" hover-class="common-hover" :hover-stay-time="50">
+						<view class="order-item" @click="navTo('/pages/user/wallet')" hover-class="common-hover" :hover-stay-time="50">
 							<view class="icon icon-b"><image class="icon-img" src="/static/user/yongjin.png" mode="aspectFit"></image></view>
-							<view class="order-font">我的钱包</view>
+							<view class="order-font">我的佣金</view>
 						</view>
-						<view class="order-item" @click="navTo('/pages/user/shareQrCode')" hover-class="common-hover" :hover-stay-time="50">
+						<view class="order-item" @click="navTo('/pages/user/team')" hover-class="common-hover" :hover-stay-time="50">
 							<view class="icon icon-b"><image class="icon-img" src="/static/user/yaoqing.png" mode="aspectFit"></image></view>
-							<view class="order-font">邀请有礼</view>
+							<view class="order-font">我的推广</view>
 						</view>
-						<view class="order-item" @click="navTo('/pages/user/team')" hover-class="common-hover" :hover-stay-time="50">
+						<view class="order-item" @click="navTo('/pages/user/shareQrCode')" hover-class="common-hover" :hover-stay-time="50">
 							<view class="icon icon-b"><image class="icon-img" src="/static/user/tuiguang.png" mode="aspectFit"></image></view>
-							<view class="order-font">我的推广</view>
+							<view class="order-font">邀请海报</view>
 						</view>
 					</view>
 				</view>

+ 1 - 1
store/index.js

@@ -6,7 +6,7 @@ Vue.use(Vuex)
 const store = new Vuex.Store({
 	state: {
 		// baseURL:"http://yrh.liuniu946.com",//'http://eb.shuibo.net',//请求地址配置 
-		baseURL:'https://dlzx.liuniu946.com',//请求地址配置 
+		baseURL:'http://zy.frp.liuniu946.com',//请求地址配置 
 		urlFile:'/index',//项目部署所在文件夹
 		userInfo: {}, //登录信息
 		loginInterceptor:false,//是否打开强制登录