Commit 0a428ad35ea407ee6bae7a887fa4d268b9e41f9e

Authored by 王强
2 parents bf46ab3d 6509f975

Merge branch 'version_2.0.0_optimization_mall_update' of http://bj.gitlab.cnlive…

….com/w-front-end/select_good into version_2.0.0_optimization_mall_update
src/components/goodsItem_2/goodsItem_2.vue
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 <div class="title" :class="{'grey': item.num, 'align-center': pid == '5' || item.num}" v-if="pid == undefined || pid == '1' || pid == '3' || pid == '4' || pid == '5'">{{item.title}}</div> 12 <div class="title" :class="{'grey': item.num, 'align-center': pid == '5' || item.num}" v-if="pid == undefined || pid == '1' || pid == '3' || pid == '4' || pid == '5'">{{item.title}}</div>
13 13
14 <!-- 因积分商城不价格所有加上 !item.grade判断 --> 14 <!-- 因积分商城不价格所有加上 !item.grade判断 -->
15 - <div class="price-box" v-if="pid != '5' && !item.num"> 15 + <div class="price-box" v-if="pid != '5'">
16 <div class="symbol">¥&nbsp;</div> 16 <div class="symbol">¥&nbsp;</div>
17 <div class="price">{{item.price}}</div> 17 <div class="price">{{item.price}}</div>
18 <div class="prices" v-if="(pid == '3' || pid == '4') && item.prices && parseFloat(item.prices) > 0 && parseFloat(item.prices) > parseFloat(item.price)">¥{{item.prices}}</div> 18 <div class="prices" v-if="(pid == '3' || pid == '4') && item.prices && parseFloat(item.prices) > 0 && parseFloat(item.prices) > parseFloat(item.price)">¥{{item.prices}}</div>
src/pages/newDaren/newDaren.vue
@@ -134,6 +134,18 @@ export default { @@ -134,6 +134,18 @@ export default {
134 // 达人最新动态 134 // 达人最新动态
135 this.getNewDynamicList(); 135 this.getNewDynamicList();
136 }, 136 },
  137 + mounted () {
  138 + // 页面显示监听
  139 + document.addEventListener('visibilitychange', () => {
  140 +
  141 + // 页面显示出来了
  142 + if (document.hidden === false) {
  143 +
  144 + // 刷新达人详情页信息接口
  145 + this.newDarenIndex();
  146 + }
  147 + });
  148 + },
137 methods: { 149 methods: {
138 /** 150 /**
139 * 达人最新动态 151 * 达人最新动态
src/pages/pointsMall/pointsMall.vue
@@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@
58 <!-- 商品展示样式 2 --> 58 <!-- 商品展示样式 2 -->
59 <goods-item-2 class="item" v-for="(item, index) in goodsLists" :key="index" @jump="toDetail(item)" 59 <goods-item-2 class="item" v-for="(item, index) in goodsLists" :key="index" @jump="toDetail(item)"
60 :item="item" 60 :item="item"
61 - pid="4"> 61 + pid="5">
62 </goods-item-2> 62 </goods-item-2>
63 </div> 63 </div>
64 64
src/pages/recommendMore/recommendMore.vue
@@ -27,214 +27,226 @@ @@ -27,214 +27,226 @@
27 </template> 27 </template>
28 28
29 <script> 29 <script>
30 - // 引入组件  
31 - import { Toast, Indicator } from 'mint-ui';  
32 - import backBox from "@/components/backBox/backBox";  
33 - import dresserList from "@/components/dresserList/dresserList";  
34 -  
35 - export default {  
36 - name: 'fansShopMessageList',  
37 - data() {  
38 - return {  
39 - title: "",  
40 - backs: { // nav导航条数据  
41 - title: "推荐达人",  
42 - funcs: {  
43 - back: {  
44 - icon: "static/img/icon_back.png"  
45 - }  
46 - }  
47 - },  
48 - list: null, // 达人列表  
49 - loading: false, // 上拉加载控制  
50 - pages:0, // 分页  
51 - }  
52 - },  
53 - components: {  
54 - backBox,  
55 - dresserList  
56 - },  
57 - created() {  
58 -  
59 - // 设置标题  
60 - this.$set(this, "title", "推荐达人页");  
61 - document.title = "推荐达人页"  
62 - // 获取更多的推荐达人  
63 - this.recommendMore();  
64 - },  
65 - methods: {  
66 -  
67 - // 下拉刷新  
68 - // onRefresh() {  
69 -  
70 - // // 下拉刷新中  
71 - // this.$set(this, "isLoading", true);  
72 -  
73 - // // 获取关注人列表  
74 - // this.fansShopMessageList();  
75 - // },  
76 -  
77 - /**  
78 - * 已关注达人列表  
79 - */  
80 - recommendMore () {  
81 -  
82 - // 校验登录  
83 - if (this.$parent.checkLogin()) {  
84 - this.loading = true;  
85 - this.pages++  
86 - // 加载中提示  
87 - Indicator.open("加载中...");  
88 -  
89 - // 请求接口  
90 - this.http("/Api/" + this.getApiVersion().dynamic + "/hotDarenList", {  
91 - uid: this.getStore("uid"),  
92 - page: this.pages  
93 - },this.recommendMoreCallback, {  
94 - method: "post"  
95 - });  
96 - }  
97 - },  
98 -  
99 - /**  
100 - * 已关注达人列表回调  
101 - * @param {object} res [服务器返回数据]  
102 - * @param {object} ext [扩展参数]  
103 - */  
104 - recommendMoreCallback(res, ext) {  
105 -  
106 - // 加载完成  
107 - Indicator.close();  
108 -  
109 - // 下拉刷新结束  
110 - this.$set(this, "isLoading", false);  
111 -  
112 - // 返回处理  
113 - if (res.code == 200) {  
114 -  
115 - // 解构数据  
116 - let {data: datas} = res;  
117 -  
118 - /*获取裂变数据*/  
119 - if (datas.list && datas.list.length) {  
120 - // 隐藏加载圈  
121 - this.loading = false;  
122 - if(this.pages>1){  
123 - this.$set(this, "list",[...this.list,...datas.list]);  
124 - }else {  
125 - this.$set(this, "list",datas.list);  
126 - }  
127 -  
128 - }  
129 - }  
130 - },  
131 - /**  
132 - * 关注/取消关注达人  
133 - */  
134 - fansShop(item) {  
135 - Indicator.open("加载中...");  
136 - // 判断必要参数  
137 - if (item.id && this.$route.query.uid) {  
138 - // 请求接口  
139 - this.http("/Api/" + this.getApiVersion().dynamic + "/fansShop", {  
140 - id: item.id || 0,  
141 - uid: this.getStore("uid") || 0  
142 - }, this.fansShopCallback, {  
143 - method: "post",  
144 - item  
145 - }  
146 - );  
147 - }  
148 - },  
149 -  
150 - /**  
151 - * 关注/取消关注达人回调  
152 - * @param {object} res [服务器返回数据]  
153 - * @param {object} ext [扩展参数]  
154 - */  
155 - fansShopCallback(res, ext) {  
156 -  
157 - // 加载完成  
158 - Indicator.close();  
159 - if (res.code) {  
160 - // 设置已关注  
161 - if (ext.item.is_fans == "0") {  
162 - // 关注达人  
163 - this.$set(ext.item, "is_fans", "1");  
164 - }else{  
165 - // 取消关注达人  
166 - this.$set(ext.item, "is_fans", "0");  
167 - }  
168 - }else if (res.statusCode === 200 && res.data.code == 400) {  
169 -  
170 - // 关注失败  
171 - Toast(res.data.message);  
172 - } else {  
173 -  
174 - // 关注失败  
175 - Toast("关注失败");  
176 - }  
177 - },  
178 - /**  
179 - * 通用跳转  
180 - * @param {object} item [数据对象]  
181 - */  
182 - toDetail(item) {  
183 - // 判断并调用通用跳转  
184 - if (typeof this.$parent.gotoDetail === "function") {  
185 -  
186 - // 临时,设置跳转达人个人主页用户数据  
187 - Object.assign(item, {  
188 - type: "5",  
189 - to: (this.mode == "prod") ? "https://managemall.cnlive.com/html/preferred-library/1/#/pages/darenProfile/darenProfile?from=redirect" + "&id=" + item.id + "&uid=" + this.getStore("uid")  
190 - : "https://wjjshop.cnlive.com/html/preferred-library/1/#/pages/darenProfile/darenProfile?from=redirect"+ "&id=" + item.id + "&uid=" + this.getStore("uid"),  
191 - shop_type: ""  
192 - });  
193 -  
194 - // 调用通用跳转  
195 - this.$parent.gotoDetail(item);  
196 - }  
197 - },  
198 -  
199 - /**  
200 - * 后退  
201 - */  
202 - back() {  
203 -  
204 - // 判断是否有后退函数  
205 - if (typeof this.$parent.back === "function") {  
206 -  
207 - // 调用后退  
208 - this.$parent.back();  
209 - } else {  
210 -  
211 - // 后退  
212 - window.history.go(-1);  
213 - }  
214 - }  
215 - },  
216 - head: {  
217 - title () {  
218 - return {  
219 - inner: this.title  
220 - }  
221 - }  
222 - },  
223 - watch: {  
224 -  
225 - // 设置页面标题  
226 - title(newVal) {  
227 - if (this.$store.state.browser.toLowerCase() == "qq" && this.$store.state.deviceType.toLowerCase() == "iphone") {  
228 - this.$iFrame.insertIFrame(newVal);  
229 - } else {  
230 - this.$emit("updateHead");  
231 - }  
232 - } 30 +// 引入组件
  31 +import { Toast, Indicator } from 'mint-ui';
  32 +import backBox from "@/components/backBox/backBox";
  33 +import dresserList from "@/components/dresserList/dresserList";
  34 +
  35 +export default {
  36 + name: 'fansShopMessageList',
  37 + data () {
  38 + return {
  39 + title: "",
  40 + backs: { // nav导航条数据
  41 + title: "推荐达人",
  42 + funcs: {
  43 + back: {
  44 + icon: "static/img/icon_back.png"
  45 + }
233 } 46 }
  47 + },
  48 + list: null, // 达人列表
  49 + loading: false, // 上拉加载控制
  50 + pages: 0, // 分页
234 } 51 }
  52 + },
  53 + components: {
  54 + backBox,
  55 + dresserList
  56 + },
  57 + created () {
  58 +
  59 + // 设置标题
  60 + this.$set(this, "title", "推荐达人页");
  61 + document.title = "推荐达人页"
  62 + // 获取更多的推荐达人
  63 + this.recommendMore();
  64 + },
  65 + methods: {
  66 +
  67 + // 下拉刷新
  68 + // onRefresh() {
  69 +
  70 + // // 下拉刷新中
  71 + // this.$set(this, "isLoading", true);
  72 +
  73 + // // 获取关注人列表
  74 + // this.fansShopMessageList();
  75 + // },
  76 +
  77 + /**
  78 + * 已关注达人列表
  79 + */
  80 + recommendMore () {
  81 +
  82 + // 校验登录
  83 + if (this.$parent.checkLogin()) {
  84 + this.loading = true;
  85 + this.pages++
  86 + // 加载中提示
  87 + Indicator.open("加载中...");
  88 +
  89 + // 请求接口
  90 + this.http("/Api/" + this.getApiVersion().dynamic + "/hotDarenList", {
  91 + uid: this.getStore("uid"),
  92 + page: this.pages
  93 + }, this.recommendMoreCallback, {
  94 + method: "post"
  95 + });
  96 + }
  97 + },
  98 +
  99 + /**
  100 + * 已关注达人列表回调
  101 + * @param {object} res [服务器返回数据]
  102 + * @param {object} ext [扩展参数]
  103 + */
  104 + recommendMoreCallback (res, ext) {
  105 +
  106 + // 加载完成
  107 + Indicator.close();
  108 +
  109 + // 下拉刷新结束
  110 + this.$set(this, "isLoading", false);
  111 +
  112 + // 返回处理
  113 + if (res.code == 200) {
  114 +
  115 + // 解构数据
  116 + let { data: datas } = res;
  117 +
  118 + /*获取裂变数据*/
  119 + if (datas.list && datas.list.length) {
  120 + // 隐藏加载圈
  121 + this.loading = false;
  122 + if (this.pages > 1) {
  123 + this.$set(this, "list", [...this.list, ...datas.list]);
  124 + } else {
  125 + this.$set(this, "list", datas.list);
  126 + }
  127 +
  128 + }
  129 + }
  130 + },
  131 + /**
  132 + * 关注/取消关注达人
  133 + */
  134 + fansShop (item) {
  135 + Indicator.open("加载中...");
  136 + // 判断必要参数
  137 + if (item.id && this.$route.query.uid) {
  138 + // 请求接口
  139 + this.http("/Api/" + this.getApiVersion().dynamic + "/fansShop", {
  140 + id: item.id || 0,
  141 + uid: this.getStore("uid") || 0
  142 + }, this.fansShopCallback, {
  143 + method: "post",
  144 + item
  145 + }
  146 + );
  147 + }
  148 + },
  149 +
  150 + /**
  151 + * 关注/取消关注达人回调
  152 + * @param {object} res [服务器返回数据]
  153 + * @param {object} ext [扩展参数]
  154 + */
  155 + fansShopCallback (res, ext) {
  156 +
  157 + // 加载完成
  158 + Indicator.close();
  159 + if (res.code) {
  160 + // 设置已关注
  161 + if (ext.item.is_fans == "0") {
  162 + // 关注达人
  163 + this.$set(ext.item, "is_fans", "1");
  164 + } else {
  165 + // 取消关注达人
  166 + this.$set(ext.item, "is_fans", "0");
  167 + }
  168 + } else if (res.statusCode === 200 && res.data.code == 400) {
  169 +
  170 + // 关注失败
  171 + Toast(res.data.message);
  172 + } else {
  173 +
  174 + // 关注失败
  175 + Toast("关注失败");
  176 + }
  177 + },
  178 + /**
  179 + * 通用跳转
  180 + * @param {object} item [数据对象]
  181 + */
  182 + toDetail (item) {
  183 + // 判断并调用通用跳转
  184 + if (typeof this.$parent.gotoDetail === "function") {
  185 +
  186 + // 临时,设置跳转达人个人主页用户数据
  187 + Object.assign(item, {
  188 + type: "5",
  189 + to: (this.mode == "prod") ? "https://managemall.cnlive.com/html/preferred-library/1/#/pages/darenProfile/darenProfile?from=redirect" + "&id=" + item.id + "&uid=" + this.getStore("uid")
  190 + : "https://wjjshop.cnlive.com/html/preferred-library/1/#/pages/darenProfile/darenProfile?from=redirect" + "&id=" + item.id + "&uid=" + this.getStore("uid"),
  191 + shop_type: ""
  192 + });
  193 +
  194 + // 调用通用跳转
  195 + this.$parent.gotoDetail(item);
  196 + }
  197 + },
  198 +
  199 + /**
  200 + * 后退
  201 + */
  202 + back () {
  203 +
  204 + // 判断是否有后退函数
  205 + if (typeof this.$parent.back === "function") {
  206 +
  207 + // 调用后退
  208 + this.$parent.back();
  209 + } else {
  210 +
  211 + // 后退
  212 + window.history.go(-1);
  213 + }
  214 + }
  215 + },
  216 + head: {
  217 + title () {
  218 + return {
  219 + inner: this.title
  220 + }
  221 + }
  222 + },
  223 + watch: {
  224 +
  225 + // 设置页面标题
  226 + title (newVal) {
  227 + if (this.$store.state.browser.toLowerCase() == "qq" && this.$store.state.deviceType.toLowerCase() == "iphone") {
  228 + this.$iFrame.insertIFrame(newVal);
  229 + } else {
  230 + this.$emit("updateHead");
  231 + }
  232 + }
  233 + },
  234 + mounted () {
  235 + // 页面显示监听
  236 + document.addEventListener('visibilitychange', () => {
  237 +
  238 + // 页面显示出来了
  239 + if (document.hidden === false) {
  240 +
  241 + // 刷新达人更多详情页信息接口
  242 + this.recommendMore();
  243 + }
  244 + });
  245 + },
  246 +}
235 </script> 247 </script>
236 248
237 <!-- Add "scoped" attribute to limit CSS to this component only --> 249 <!-- Add "scoped" attribute to limit CSS to this component only -->
238 <style rel="stylesheet/less" lang="less" scoped> 250 <style rel="stylesheet/less" lang="less" scoped>
239 - @import "recommendMore"; 251 +@import 'recommendMore';
240 </style> 252 </style>