xiebaomin 1 سال پیش
والد
کامیت
c1b90fcd4c

+ 191 - 190
components/thorui/tui-icon/tui-icon.js

@@ -1,190 +1,191 @@
-export default {
-	"about": "\ue772",
-	"about-fill": "\ue771",
-	"add": "\ue770",
-	"add-fill": "\ue76f",
-	"addmessage": "\ue76e",
-	"addressbook": "\ue76d",
-	"agree": "\ue76c",
-	"agree-fill": "\ue76b",
-	"alarm": "\ue76a",
-	"alarm-fill": "\ue769",
-	"alipay": "\ue768",
-	"android": "\ue767",
-	"applets": "\ue766",
-	"arrowdown": "\ue765",
-	"arrowleft": "\ue764",
-	"arrowright": "\ue763",
-	"arrowup": "\ue762",
-	"attestation": "\ue761",
-	"back": "\ue760",
-	"bag": "\ue75f",
-	"bag-fill": "\ue75e",
-	"balloon": "\ue75d",
-	"bankcard": "\ue75c",
-	"bankcard-fill": "\ue75b",
-	"bottom": "\ue75a",
-	"calendar": "\ue759",
-	"camera": "\ue758",
-	"camera-fill": "\ue757",
-	"camera-add": "\ue756",
-	"card": "\ue755",
-	"card-fill": "\ue754",
-	"cart": "\ue753",
-	"cart-fill": "\ue752",
-	"category": "\ue751",
-	"category-fill": "\ue750",
-	"check": "\ue74f",
-	"circle": "\ue74e",
-	"circle-fill": "\ue74d",
-	"circle-selected": "\ue74c",
-	"clock": "\ue74b",
-	"clock-fill": "\ue74a",
-	"close": "\ue749",
-	"close-fill": "\ue748",
-	"community": "\ue747",
-	"community-fill": "\ue746",
-	"computer": "\ue745",
-	"computer-fill": "\ue744",
-	"coupon": "\ue743",
-	"delete": "\ue742",
-	"deletekey": "\ue741",
-	"dingtalk": "\ue740",
-	"dissatisfied": "\ue73f",
-	"down": "\ue73e",
-	"download": "\ue73d",
-	"edit": "\ue73c",
-	"ellipsis": "\ue73b",
-	"enlarge": "\ue73a",
-	"evaluate": "\ue739",
-	"exchange": "\ue738",
-	"explain": "\ue737",
-	"explain-fill": "\ue736",
-	"explore": "\ue735",
-	"explore-fill": "\ue734",
-	"eye": "\ue733",
-	"feedback": "\ue732",
-	"fingerprint": "\ue730",
-	"friendadd": "\ue72f",
-	"friendadd-fill": "\ue72e",
-	"gps": "\ue72d",
-	"histogram": "\ue72c",
-	"home": "\ue72b",
-	"home-fill": "\ue72a",
-	"house": "\ue729",
-	"imface": "\ue728",
-	"imkeyboard": "\ue727",
-	"immore": "\ue726",
-	"imvoice": "\ue725",
-	"ios": "\ue724",
-	"kefu": "\ue723",
-	"label": "\ue722",
-	"label-fill": "\ue721",
-	"like": "\ue720",
-	"like-fill": "\ue71f",
-	"link": "\ue71e",
-	"listview": "\ue71d",
-	"loading": "\ue71c",
-	"location": "\ue71b",
-	"mail": "\ue71a",
-	"mail-fill": "\ue719",
-	"manage": "\ue718",
-	"manage-fill": "\ue717",
-	"member": "\ue716",
-	"member-fill": "\ue715",
-	"message": "\ue714",
-	"message-fill": "\ue713",
-	"mobile": "\ue712",
-	"moments": "\ue711",
-	"more": "\ue710",
-	"more-fill": "\ue70f",
-	"narrow": "\ue70e",
-	"news": "\ue70d",
-	"news-fill": "\ue70c",
-	"nodata": "\ue70b",
-	"notice": "\ue699",
-	"notice-fill": "\ue698",
-	"offline": "\ue697",
-	"offline-fill": "\ue696",
-	"oppose": "\ue695",
-	"oppose-fill": "\ue694",
-	"order": "\ue693",
-	"partake": "\ue692",
-	"people": "\ue691",
-	"people-fill": "\ue690",
-	"pic": "\ue68f",
-	"pic-fill": "\ue68e",
-	"picture": "\ue68d",
-	"pie": "\ue68c",
-	"plus": "\ue689",
-	"polygonal": "\ue688",
-	"position": "\ue686",
-	"pwd": "\ue685",
-	"qq": "\ue684",
-	"qrcode": "\ue682",
-	"redpacket": "\ue681",
-	"redpacket-fill": "\ue680",
-	"reduce": "\ue67f",
-	"refresh": "\ue67e",
-	"revoke": "\ue67d",
-	"satisfied": "\ue67c",
-	"screen": "\ue67b",
-	"search": "\ue67a",
-	"search-2": "\ue679",
-	"send": "\ue678",
-	"service": "\ue677",
-	"service-fill": "\ue676",
-	"setup": "\ue675",
-	"setup-fill": "\ue674",
-	"share": "\ue673",
-	"share-fill": "\ue672",
-	"shield": "\ue671",
-	"shop": "\ue670",
-	"shop-fill": "\ue66f",
-	"shut": "\ue66e",
-	"signin": "\ue66d",
-	"sina": "\ue66c",
-	"skin": "\ue66b",
-	"soso": "\ue669",
-	"square": "\ue668",
-	"square-fill": "\ue667",
-	"square-selected": "\ue666",
-	"star": "\ue665",
-	"star-fill": "\ue664",
-	"strategy": "\ue663",
-	"sweep": "\ue662",
-	"time": "\ue661",
-	"time-fill": "\ue660",
-	"todown": "\ue65f",
-	"toleft": "\ue65e",
-	"tool": "\ue65d",
-	"top": "\ue65c",
-	"toright": "\ue65b",
-	"towardsleft": "\ue65a",
-	"towardsright": "\ue659",
-	"towardsright-fill": "\ue658",
-	"transport": "\ue657",
-	"transport-fill": "\ue656",
-	"turningdown": "\ue654",
-	"turningleft": "\ue653",
-	"turningright": "\ue652",
-	"turningup": "\ue651",
-	"unreceive": "\ue650",
-	"seen": "\ue7d2",
-	"unseen": "\ue7d1",
-	"up": "\ue64e",
-	"upload": "\ue64c",
-	"video": "\ue64b",
-	"voice": "\ue649",
-	"voice-fill": "\ue648",
-	"voipphone": "\ue647",
-	"wallet": "\ue646",
-	"warning": "\ue645",
-	"wealth": "\ue644",
-	"wealth-fill": "\ue643",
-	"weather": "\ue642",
-	"wechat": "\ue641",
-	"wifi": "\ue640",
-	"play": "\ue7d5",
-	"suspend": "\ue7d4"
-}
+export default {
+	'about': '\ue772',
+	'about-fill': '\ue771',
+	'add': '\ue770',
+	'add-fill': '\ue76f',
+	'addmessage': '\ue76e',
+	'addressbook': '\ue76d',
+	'agree': '\ue76c',
+	'agree-fill': '\ue76b',
+	'alarm': '\ue76a',
+	'alarm-fill': '\ue769',
+	'alipay': '\ue768',
+	'android': '\ue767',
+	'applets': '\ue766',
+	'arrowdown': '\ue765',
+	'arrowleft': '\ue764',
+	'arrowright': '\ue763',
+	'arrowup': '\ue762',
+	'attestation': '\ue761',
+	'back': '\ue760',
+	'bag': '\ue75f',
+	'bag-fill': '\ue75e',
+	'balloon': '\ue75d',
+	'bankcard': '\ue75c',
+	'bankcard-fill': '\ue75b',
+	'bottom': '\ue75a',
+	'calendar': '\ue759',
+	'camera': '\ue758',
+	'camera-fill': '\ue757',
+	'camera-add': '\ue756',
+	'card': '\ue755',
+    'call': '\ue755',
+	'card-fill': '\ue754',
+	'cart': '\ue753',
+	'cart-fill': '\ue752',
+	'category': '\ue751',
+	'category-fill': '\ue750',
+	'check': '\ue74f',
+	'circle': '\ue74e',
+	'circle-fill': '\ue74d',
+	'circle-selected': '\ue74c',
+	'clock': '\ue74b',
+	'clock-fill': '\ue74a',
+	'close': '\ue749',
+	'close-fill': '\ue748',
+	'community': '\ue747',
+	'community-fill': '\ue746',
+	'computer': '\ue745',
+	'computer-fill': '\ue744',
+	'coupon': '\ue743',
+	'delete': '\ue742',
+	'deletekey': '\ue741',
+	'dingtalk': '\ue740',
+	'dissatisfied': '\ue73f',
+	'down': '\ue73e',
+	'download': '\ue73d',
+	'edit': '\ue73c',
+	'ellipsis': '\ue73b',
+	'enlarge': '\ue73a',
+	'evaluate': '\ue739',
+	'exchange': '\ue738',
+	'explain': '\ue737',
+	'explain-fill': '\ue736',
+	'explore': '\ue735',
+	'explore-fill': '\ue734',
+	'eye': '\ue733',
+	'feedback': '\ue732',
+	'fingerprint': '\ue730',
+	'friendadd': '\ue72f',
+	'friendadd-fill': '\ue72e',
+	'gps': '\ue72d',
+	'histogram': '\ue72c',
+	'home': '\ue72b',
+	'home-fill': '\ue72a',
+	'house': '\ue729',
+	'imface': '\ue728',
+	'imkeyboard': '\ue727',
+	'immore': '\ue726',
+	'imvoice': '\ue725',
+	'ios': '\ue724',
+	'kefu': '\ue723',
+	'label': '\ue722',
+	'label-fill': '\ue721',
+	'like': '\ue720',
+	'like-fill': '\ue71f',
+	'link': '\ue71e',
+	'listview': '\ue71d',
+	'loading': '\ue71c',
+	'location': '\ue71b',
+	'mail': '\ue71a',
+	'mail-fill': '\ue719',
+	'manage': '\ue718',
+	'manage-fill': '\ue717',
+	'member': '\ue716',
+	'member-fill': '\ue715',
+	'message': '\ue714',
+	'message-fill': '\ue713',
+	'mobile': '\ue712',
+	'moments': '\ue711',
+	'more': '\ue710',
+	'more-fill': '\ue70f',
+	'narrow': '\ue70e',
+	'news': '\ue70d',
+	'news-fill': '\ue70c',
+	'nodata': '\ue70b',
+	'notice': '\ue699',
+	'notice-fill': '\ue698',
+	'offline': '\ue697',
+	'offline-fill': '\ue696',
+	'oppose': '\ue695',
+	'oppose-fill': '\ue694',
+	'order': '\ue693',
+	'partake': '\ue692',
+	'people': '\ue691',
+	'people-fill': '\ue690',
+	'pic': '\ue68f',
+	'pic-fill': '\ue68e',
+	'picture': '\ue68d',
+	'pie': '\ue68c',
+	'plus': '\ue689',
+	'polygonal': '\ue688',
+	'position': '\ue686',
+	'pwd': '\ue685',
+	'qq': '\ue684',
+	'qrcode': '\ue682',
+	'redpacket': '\ue681',
+	'redpacket-fill': '\ue680',
+	'reduce': '\ue67f',
+	'refresh': '\ue67e',
+	'revoke': '\ue67d',
+	'satisfied': '\ue67c',
+	'screen': '\ue67b',
+	'search': '\ue67a',
+	'search-2': '\ue679',
+	'send': '\ue678',
+	'service': '\ue677',
+	'service-fill': '\ue676',
+	'setup': '\ue675',
+	'setup-fill': '\ue674',
+	'share': '\ue673',
+	'share-fill': '\ue672',
+	'shield': '\ue671',
+	'shop': '\ue670',
+	'shop-fill': '\ue66f',
+	'shut': '\ue66e',
+	'signin': '\ue66d',
+	'sina': '\ue66c',
+	'skin': '\ue66b',
+	'soso': '\ue669',
+	'square': '\ue668',
+	'square-fill': '\ue667',
+	'square-selected': '\ue666',
+	'star': '\ue665',
+	'star-fill': '\ue664',
+	'strategy': '\ue663',
+	'sweep': '\ue662',
+	'time': '\ue661',
+	'time-fill': '\ue660',
+	'todown': '\ue65f',
+	'toleft': '\ue65e',
+	'tool': '\ue65d',
+	'top': '\ue65c',
+	'toright': '\ue65b',
+	'towardsleft': '\ue65a',
+	'towardsright': '\ue659',
+	'towardsright-fill': '\ue658',
+	'transport': '\ue657',
+	'transport-fill': '\ue656',
+	'turningdown': '\ue654',
+	'turningleft': '\ue653',
+	'turningright': '\ue652',
+	'turningup': '\ue651',
+	'unreceive': '\ue650',
+	'seen': '\ue7d2',
+	'unseen': '\ue7d1',
+	'up': '\ue64e',
+	'upload': '\ue64c',
+	'video': '\ue64b',
+	'voice': '\ue649',
+	'voice-fill': '\ue648',
+	'voipphone': '\ue647',
+	'wallet': '\ue646',
+	'warning': '\ue645',
+	'wealth': '\ue644',
+	'wealth-fill': '\ue643',
+	'weather': '\ue642',
+	'wechat': '\ue641',
+	'wifi': '\ue640',
+	'play': '\ue7d5',
+	'suspend': '\ue7d4'
+}

+ 200 - 200
js_sdk/luch-request/luch-request/core/Request.js

@@ -1,200 +1,200 @@
-/**
- * @Class Request
- * @description luch-request http请求插件
- * @version 3.0.7
- * @Author lu-ch
- * @Date 2021-09-04
- * @Email webwork.s@qq.com
- * 文档: https://www.quanzhan.co/luch-request/
- * github: https://github.com/lei-mu/luch-request
- * DCloud: http://ext.dcloud.net.cn/plugin?id=392
- * HBuilderX: beat-3.0.4 alpha-3.0.4
- */
-
-
-import dispatchRequest from './dispatchRequest'
-import InterceptorManager from './InterceptorManager'
-import mergeConfig from './mergeConfig'
-import defaults from './defaults'
-import { isPlainObject } from '../utils'
-import clone from '../utils/clone'
-
-export default class Request {
-  /**
-   * @param {Object} arg - 全局配置
-   * @param {String} arg.baseURL - 全局根路径
-   * @param {Object} arg.header - 全局header
-   * @param {String} arg.method = [GET|POST|PUT|DELETE|CONNECT|HEAD|OPTIONS|TRACE] - 全局默认请求方式
-   * @param {String} arg.dataType = [json] - 全局默认的dataType
-   * @param {String} arg.responseType = [text|arraybuffer] - 全局默认的responseType。支付宝小程序不支持
-   * @param {Object} arg.custom - 全局默认的自定义参数
-   * @param {Number} arg.timeout - 全局默认的超时时间,单位 ms。默认60000。H5(HBuilderX 2.9.9+)、APP(HBuilderX 2.9.9+)、微信小程序(2.10.0)、支付宝小程序
-   * @param {Boolean} arg.sslVerify - 全局默认的是否验证 ssl 证书。默认true.仅App安卓端支持(HBuilderX 2.3.3+)
-   * @param {Boolean} arg.withCredentials - 全局默认的跨域请求时是否携带凭证(cookies)。默认false。仅H5支持(HBuilderX 2.6.15+)
-   * @param {Boolean} arg.firstIpv4 - 全DNS解析时优先使用ipv4。默认false。仅 App-Android 支持 (HBuilderX 2.8.0+)
-   * @param {Function(statusCode):Boolean} arg.validateStatus - 全局默认的自定义验证器。默认statusCode >= 200 && statusCode < 300
-   */
-  constructor(arg = {}) {
-    if (!isPlainObject(arg)) {
-      arg = {}
-      console.warn('设置全局参数必须接收一个Object')
-    }
-    this.config = clone({...defaults, ...arg})
-    this.interceptors = {
-      request: new InterceptorManager(),
-      response: new InterceptorManager()
-    }
-  }
-
-  /**
-   * @Function
-   * @param {Request~setConfigCallback} f - 设置全局默认配置
-   */
-  setConfig(f) {
-    this.config = f(this.config)
-  }
-
-  middleware(config) {
-    config = mergeConfig(this.config, config)
-    let chain = [dispatchRequest, undefined]
-    let promise = Promise.resolve(config)
-
-    this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
-      chain.unshift(interceptor.fulfilled, interceptor.rejected)
-    })
-
-    this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
-      chain.push(interceptor.fulfilled, interceptor.rejected)
-    })
-
-    while (chain.length) {
-      promise = promise.then(chain.shift(), chain.shift())
-    }
-
-    return promise
-  }
-
-  /**
-   * @Function
-   * @param {Object} config - 请求配置项
-   * @prop {String} options.url - 请求路径
-   * @prop {Object} options.data - 请求参数
-   * @prop {Object} [options.responseType = config.responseType] [text|arraybuffer] - 响应的数据类型
-   * @prop {Object} [options.dataType = config.dataType] - 如果设为 json,会尝试对返回的数据做一次 JSON.parse
-   * @prop {Object} [options.header = config.header] - 请求header
-   * @prop {Object} [options.method = config.method] - 请求方法
-   * @returns {Promise<unknown>}
-   */
-  request(config = {}) {
-    return this.middleware(config)
-  }
-
-  get(url, options = {}) {
-    return this.middleware({
-      url,
-      method: 'GET',
-      ...options
-    })
-  }
-
-  post(url, data, options = {}) {
-    return this.middleware({
-      url,
-      data,
-      method: 'POST',
-      ...options
-    })
-  }
-
-  // #ifndef MP-ALIPAY
-  put(url, data, options = {}) {
-    return this.middleware({
-      url,
-      data,
-      method: 'PUT',
-      ...options
-    })
-  }
-
-  // #endif
-
-  // #ifdef APP-PLUS || H5 || MP-WEIXIN || MP-BAIDU
-  delete(url, data, options = {}) {
-    return this.middleware({
-      url,
-      data,
-      method: 'DELETE',
-      ...options
-    })
-  }
-
-  // #endif
-
-  // #ifdef H5 || MP-WEIXIN
-  connect(url, data, options = {}) {
-    return this.middleware({
-      url,
-      data,
-      method: 'CONNECT',
-      ...options
-    })
-  }
-
-  // #endif
-
-  // #ifdef  H5 || MP-WEIXIN || MP-BAIDU
-  head(url, data, options = {}) {
-    return this.middleware({
-      url,
-      data,
-      method: 'HEAD',
-      ...options
-    })
-  }
-
-  // #endif
-
-  // #ifdef APP-PLUS || H5 || MP-WEIXIN || MP-BAIDU
-  options(url, data, options = {}) {
-    return this.middleware({
-      url,
-      data,
-      method: 'OPTIONS',
-      ...options
-    })
-  }
-
-  // #endif
-
-  // #ifdef H5 || MP-WEIXIN
-  trace(url, data, options = {}) {
-    return this.middleware({
-      url,
-      data,
-      method: 'TRACE',
-      ...options
-    })
-  }
-
-  // #endif
-
-  upload(url, config = {}) {
-    config.url = url
-    config.method = 'UPLOAD'
-    return this.middleware(config)
-  }
-
-  download(url, config = {}) {
-    config.url = url
-    config.method = 'DOWNLOAD'
-    return this.middleware(config)
-  }
-}
-
-
-/**
- * setConfig回调
- * @return {Object} - 返回操作后的config
- * @callback Request~setConfigCallback
- * @param {Object} config - 全局默认config
- */
+/**
+ * @Class Request
+ * @description luch-request http请求插件
+ * @version 3.0.7
+ * @Author lu-ch
+ * @Date 2021-09-04
+ * @Email webwork.s@qq.com
+ * 文档: https://www.quanzhan.co/luch-request/
+ * github: https://github.com/lei-mu/luch-request
+ * DCloud: http://ext.dcloud.net.cn/plugin?id=392
+ * HBuilderX: beat-3.0.4 alpha-3.0.4
+ */
+
+
+import dispatchRequest from './dispatchRequest'
+import InterceptorManager from './InterceptorManager'
+import mergeConfig from './mergeConfig'
+import defaults from './defaults'
+import { isPlainObject } from '../utils'
+import clone from '../utils/clone'
+
+export default class Request {
+  /**
+   * @param {Object} arg - 全局配置
+   * @param {String} arg.baseURL - 全局根路径
+   * @param {Object} arg.header - 全局header
+   * @param {String} arg.method = [GET|POST|PUT|DELETE|CONNECT|HEAD|OPTIONS|TRACE] - 全局默认请求方式
+   * @param {String} arg.dataType = [json] - 全局默认的dataType
+   * @param {String} arg.responseType = [text|arraybuffer] - 全局默认的responseType。支付宝小程序不支持
+   * @param {Object} arg.custom - 全局默认的自定义参数
+   * @param {Number} arg.timeout - 全局默认的超时时间,单位 ms。默认60000。H5(HBuilderX 2.9.9+)、APP(HBuilderX 2.9.9+)、微信小程序(2.10.0)、支付宝小程序
+   * @param {Boolean} arg.sslVerify - 全局默认的是否验证 ssl 证书。默认true.仅App安卓端支持(HBuilderX 2.3.3+)
+   * @param {Boolean} arg.withCredentials - 全局默认的跨域请求时是否携带凭证(cookies)。默认false。仅H5支持(HBuilderX 2.6.15+)
+   * @param {Boolean} arg.firstIpv4 - 全DNS解析时优先使用ipv4。默认false。仅 App-Android 支持 (HBuilderX 2.8.0+)
+   * @param {Function(statusCode):Boolean} arg.validateStatus - 全局默认的自定义验证器。默认statusCode >= 200 && statusCode < 300
+   */
+  constructor(arg = {}) {
+    if (!isPlainObject(arg)) {
+      arg = {}
+      console.warn('设置全局参数必须接收一个Object')
+    }
+    this.config = clone({...defaults, ...arg})
+    this.interceptors = {
+      request: new InterceptorManager(),
+      response: new InterceptorManager()
+    }
+  }
+
+  /**
+   * @Function
+   * @param {Request~setConfigCallback} f - 设置全局默认配置
+   */
+  setConfig(f) {
+    this.config = f(this.config)
+  }
+
+  middleware(config) {
+    config = mergeConfig(this.config, config)
+    let chain = [dispatchRequest, undefined]
+    let promise = Promise.resolve(config)
+
+    this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
+      chain.unshift(interceptor.fulfilled, interceptor.rejected)
+    })
+
+    this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
+      chain.push(interceptor.fulfilled, interceptor.rejected)
+    })
+
+    while (chain.length) {
+      promise = promise.then(chain.shift(), chain.shift())
+    }
+
+    return promise
+  }
+
+  /**
+   * @Function
+   * @param {Object} config - 请求配置项
+   * @prop {String} options.url - 请求路径
+   * @prop {Object} options.data - 请求参数
+   * @prop {Object} [options.responseType = config.responseType] [text|arraybuffer] - 响应的数据类型
+   * @prop {Object} [options.dataType = config.dataType] - 如果设为 json,会尝试对返回的数据做一次 JSON.parse
+   * @prop {Object} [options.header = config.header] - 请求header
+   * @prop {Object} [options.method = config.method] - 请求方法
+   * @returns {Promise<unknown>}
+   */
+  request(config = {}) {
+    return this.middleware(config)
+  }
+
+  get(url, options = {}) {
+    return this.middleware({
+      url,
+      method: 'GET',
+      ...options
+    })
+  }
+
+  post(url, data, options = {}) {
+    return this.middleware({
+      url,
+      data,
+      method: 'POST',
+      ...options
+    })
+  }
+
+  // #ifndef MP-ALIPAY
+  put(url, data, options = {}) {
+    return this.middleware({
+      url,
+      data,
+      method: 'PUT',
+      ...options
+    })
+  }
+
+  // #endif
+
+  // #ifdef APP-PLUS || H5 || MP-WEIXIN || MP-BAIDU
+  delete(url, data, options = {}) {
+    return this.middleware({
+      url,
+      data,
+      method: 'DELETE',
+      ...options
+    })
+  }
+
+  // #endif
+
+  // #ifdef H5 || MP-WEIXIN
+  connect(url, data, options = {}) {
+    return this.middleware({
+      url,
+      data,
+      method: 'CONNECT',
+      ...options
+    })
+  }
+
+  // #endif
+
+  // #ifdef  H5 || MP-WEIXIN || MP-BAIDU
+  head(url, data, options = {}) {
+    return this.middleware({
+      url,
+      data,
+      method: 'HEAD',
+      ...options
+    })
+  }
+
+  // #endif
+
+  // #ifdef APP-PLUS || H5 || MP-WEIXIN || MP-BAIDU
+  options(url, data, options = {}) {
+    return this.middleware({
+      url,
+      data,
+      method: 'OPTIONS',
+      ...options
+    })
+  }
+
+  // #endif
+
+  // #ifdef H5 || MP-WEIXIN
+  trace(url, data, options = {}) {
+    return this.middleware({
+      url,
+      data,
+      method: 'TRACE',
+      ...options
+    })
+  }
+
+  // #endif
+
+  upload(url, config = {}) {
+    config.url = url
+    config.method = 'UPLOAD'
+    return this.middleware(config)
+  }
+
+  download(url, config = {}) {
+    config.url = url
+    config.method = 'DOWNLOAD'
+    return this.middleware(config)
+  }
+}
+
+
+/**
+ * setConfig回调
+ * @return {Object} - 返回操作后的config
+ * @callback Request~setConfigCallback
+ * @param {Object} config - 全局默认config
+ */

+ 14 - 0
pages.json

@@ -299,6 +299,20 @@
                 		"navigationBarTitleText": "优惠促销",
                 		"navigationBarTitleText": "优惠促销",
                 		"enablePullDownRefresh": true
                 		"enablePullDownRefresh": true
                 	}
                 	}
+                },
+                {
+                	"path": "club/notice-article",
+                	"style": {
+                		"navigationBarTitleText": "最新文章",
+                		"enablePullDownRefresh": true
+                	}
+                },
+                {
+                	"path": "club/notice-activity",
+                	"style": {
+                		"navigationBarTitleText": "最新活动",
+                		"enablePullDownRefresh": true
+                	}
                 }
                 }
             ]
             ]
         }
         }

+ 35 - 1
pages/notice/club/components/notice-cell.vue

@@ -58,7 +58,41 @@
 					{{ noticeCouponText(cell)}}
 					{{ noticeCouponText(cell)}}
 				</view> 
 				</view> 
 			</view>
 			</view>
-		</template>
+		</template>
+        <!-- 文章最新通知 -->
+        <template v-if="cellType === 5">
+            <view class="tui-notice-cell">
+            	<view class="tui-cell-top">
+            		<view class="cell-title"> 最新文章通知 </view>
+            		<view class="cell-time"> {{ cell.time }} </view>
+            	</view>
+            	<view class="tui-cell-content"> 
+            		<view class="cell-image">
+            			<img :src="cell.mainImage" alt="">
+            		</view>
+            		<view class="cell-content">
+            			{{ cell.content }}
+            		</view> 
+            	</view> 
+            </view>
+        </template>
+        <!-- 最新活动通知 -->
+        <template v-if="cellType === 6">
+        	<view class="tui-notice-cell clearfix">
+        		<view class="tui-cell-top">
+        			<view class="cell-title"> 最新活动通知 </view>
+        			<view class="cell-time"> {{ cell.time }} </view>
+        		</view>
+                <view class="tui-cell-content">
+                	<view class="cell-image">
+                		<img :src="cell.mainImage" alt="">
+                	</view>
+                    <view class="cell-content"> 
+                        {{ cell.content }}
+                    </view> 
+                </view> 
+        	</view>
+        </template>
 	</view>
 	</view>
 </template>
 </template>
 
 

+ 67 - 87
pages/notice/club/mixins/notice_mixins.js

@@ -1,5 +1,27 @@
+import { getStorage } from '@/common/storage.js'
+import { fetchMessageList, authDeleteMessage, authUpdateMessageAsRead } from '@/services/api/notice.js'
+
 // 机构通知消息 
 // 机构通知消息 
-const noticeMixins = {
+const noticeMixins = {
+    data () {
+        return {
+            params: {
+                pageSize: 10,
+                pageNum: 1,
+                commonId: 0,
+                messageType: 1
+            },
+            dataValue: [],
+            isRequest: true,
+            isEmpty: false,
+            loadding: true,
+            pullUpOn: true,
+            pullFlag: true,
+            hasNextPage: false,
+            nomoreText: '上拉显示更多',
+            showLoading: true
+        }
+    },
     filters: {
     filters: {
         noticeOrderFilters(value) { 
         noticeOrderFilters(value) { 
             // 交易物流状态显示 1.下单成功通知  2.订单支付完成 3.退款/货成功通知 4.订单取消通知 5.订单发货通知 6.自动收货通知
             // 交易物流状态显示 1.下单成功通知  2.订单支付完成 3.退款/货成功通知 4.订单取消通知 5.订单发货通知 6.自动收货通知
@@ -31,91 +53,49 @@ const noticeMixins = {
             const map = {
             const map = {
                 1: '优惠券待领取通知',
                 1: '优惠券待领取通知',
                 2: '优惠券过期通知',
                 2: '优惠券过期通知',
-                3: '优惠券待领取通知'
+                3: '优惠券即将过期通知'
             }
             }
             return map[value]
             return map[value]
         }
         }
     },
     },
     methods: {
     methods: {
-        getUserAuthClubMessageList() {
-            this.UserService.getUserAuthClubMessageList(this.listQuery)
-                .then(response => {
-                    let data = response.data
-                    this.hasNextPage = response.data.hasNextPage
-                    if (data.list && data.list.length > 0) {
-                        this.isEmpty = false
-                        this.list = [...data.list]
-                        this.pullFlag = false
-                        setTimeout(() => {
-                            this.pullFlag = true
-                        }, 500)
-                        if (this.hasNextPage) {
-                            this.pullUpOn = false
-                            this.nomoreText = '上拉显示更多'
-                        } else {
-                            if (this.list.length < 5) {
-                                this.pullUpOn = true
-                                this.loadding = false
-                            } else {
-                                this.pullUpOn = false
-                                this.loadding = false
-                                this.nomoreText = '到底了~'
-                            }
-                        }
-                    } else {
-                        this.isEmpty = true
-                    }
-                    this.skeletonShow = false
-                })
-                .catch(error => {
-                    this.$util.msg(error.msg, 2000)
-                })
-        },
-        getReachBottomData() {
-            this.pullUpOn = false
-            this.loadding = false
-            //上拉加载
-            this.listQuery.pageNum += 1
-            this.UserService.getUserAuthClubMessageList(this.listQuery)
-                .then(response => {
-                    let data = response.data
-                    if (data.list && data.list.length > 0) {
-                        this.hasNextPage = data.hasNextPage
-                        this.list = this.list.concat(data.list)
-                        this.pullFlag = false // 防上拉暴滑
-                        setTimeout(() => {
-                            this.pullFlag = true
-                        }, 500)
-                        if (this.hasNextPage) {
-                            this.pullUpOn = false
-                            this.nomoreText = '上拉显示更多'
-                        } else {
-                            this.pullUpOn = false
-                            this.loadding = false
-                            this.nomoreText = '到底了~'
-                        }
-                    }
-                })
-                .catch(error => {
-                    this.$util.msg(error.msg, 2000)
-                })
+        async getUserAuthClubMessageList() {
+            uni.showLoading({
+                title: 'loading'
+            })
+            this.params.commonId = getStorage('USER_INFO').userId || 0
+            const { data } = await fetchMessageList(this.params)
+            this.dataValue = [...this.dataValue, ...data.list]
+            this.isRequest = false
+            this.hasNextPage = data.hasNextPage
+            this.pullUpOn = false
+            this.loadding = false
+            this.showLoading = false
+            if (this.dataValue.length > 0) {
+                if (this.hasNextPage) {
+                    this.nomoreText = '上拉显示更多'
+                } else {
+                    this.nomoreText = '到底了~'
+                }
+            } else {
+                this.isEmpty = true
+            }
+            uni.hideLoading()
         },
         },
-        deleteBtn(id,index) {
-            // 删除通知消息
-            this.UserService.authDeleteMessage({ id: id })
-                .then(response => {
-                    let _this = this
-                    uni.vibrateShort({
-                        success: function() {
-                            _this.listQuery.pageNum = 1
-                            _this.getUserAuthClubMessageList()
-                            // _this.list.splice(index, 1) 
-                        }
-                    })
-                })
-                .catch(error => {
-                    console.log('error=>', error.msg)
-                })
+        async deleteBtn(id,index) {
+            // 删除通知消息
+            try {
+                await authDeleteMessage({ id, isConfig: true })
+                this.params.pageSize = this.params.pageNum * this.params.pageSize
+                this.params.pageNum = 1
+                this.dataValue = []
+                await this.getUserAuthClubMessageList()
+            } catch(e) {
+                console.log(e)
+            }
+        },
+        async clearCellNew (Id) {
+            await authUpdateMessageAsRead({ userType: 4, Id, isConfig: true })
         },
         },
         noticeOrderText(cell) { // 交易物流通知文案
         noticeOrderText(cell) { // 交易物流通知文案
             const map = {
             const map = {
@@ -142,16 +122,16 @@ const noticeMixins = {
         },
         },
         noticeCouponText(cell) { // 优惠促销通知文案
         noticeCouponText(cell) { // 优惠促销通知文案
             const copunMap = {
             const copunMap = {
-                0: `采美平台送您${cell.couponFee}元优惠券,众多大牌正品等着您,赶快去领取下单吧 >>>`,
-                1: `采美平台${cell.content}类商品大优惠,特送您${cell.couponFee}元优惠券,赶快去领取下单吧 >>>`,
-                2: `为了答谢您对采美平台的支持,采美送您${cell.couponFee}元优惠券,赶快去领取下单吧 >>>`,
-                3: `【${cell.content}】赠送您${cell.couponFee}元的店铺专属优惠券,众多火爆商品等您来!赶快去领取下单吧 >>>`,
-                4: `恭喜成功注册采美平台,现赠送您${cell.couponFee}元新用户优惠券,赶快去领取下单吧 >>>`,
+                0: `${cell.couponFee}元优惠券已派送到您的领券中心,快去领取下单吧。`,
+                2: `为了感谢您长久以来的支持,现已派送${cell.couponFee}元优惠券到您的领券中心,快去领取下单吧。`,
+                4: `恭喜您成功注册登录。现赠送${cell.couponFee}元优惠券到您的领券中心,快去领取下单吧。`,
+                5: `恭喜您成功邀请一位好友注册登录,现赠送${cell.couponFee}元优惠券到您的领券中心,快去领取下单吧。`,
+                6: `恭喜您邀请的好友已成功消费一笔订单,现赠送${cell.couponFee}元优惠券到您的领券中心,快去领取下单吧。`,
             }
             }
             const map = {
             const map = {
                 1: copunMap[cell.couponType],
                 1: copunMap[cell.couponType],
-                2: `您有${cell.couponFee}元优惠券将于${cell.content}过期,赶快去查看使用吧 >>>`,
-                3: `您有${cell.couponFee}元优惠券尚未领取,优惠券将于${cell.content}后下架,赶快去领取下单吧 >>>`,
+                2: `您有${cell.couponFee}元优惠券将于${cell.content}过期,快去使用吧。`,
+                3: `您有${cell.couponFee}元优惠券尚未领取,优惠券即将失效,快去领取下单吧。`,
             }
             }
             return map[cell.couponMessageType]
             return map[cell.couponMessageType]
         }
         }

+ 184 - 0
pages/notice/club/notice-activity.vue

@@ -0,0 +1,184 @@
+<template>
+	<view class="container cart clearfix">
+        <tui-skeleton v-if="isRequest" :loadingType="3" :isLoading="true" />
+		<view class="container-main" v-else>
+			<view class="clearfix">
+				<!-- 空白页 -->    
+				<view class="empty-container" v-if="isEmpty">
+					<image mode="aspectFill" class="empty_notice" src="@/static/tabBar/emtry_notice.png"></image>
+					<text class="error-text">暂无任何消息~</text>
+				</view>
+				<!-- 列表 -->
+				<view
+					class="tui-notice"
+					v-else
+					v-for="(cell, index) in dataValue"
+					:key="index"
+					@click.stop="handleOrderClick(cell)"
+				>
+					<tui-swipe-action :operateWidth="80" :backgroundColor="'#F7F7F7'">
+						<template v-slot:content>
+							<notice-cell :cellType="6" :cell="cell"></notice-cell>
+						</template>
+						<template v-slot:button>
+							<view class="tui-custom-btn_box">
+								<view class="tui-custom-btn" @click.stop="deleteBtn(cell.id, index)">
+									<image src="@/static/tabBar/delete_notice.png" class="deleteImage" mode="aspectFill"></image>
+								</view>
+							</view>
+						</template>
+					</tui-swipe-action>
+				</view>
+				<!--加载loadding-->
+                <view v-if="showLoading">
+                    <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
+                    <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore>
+                </view>
+				<!--加载loadding-->
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+import { mapState, mapMutations } from 'vuex'
+import noticeMixins from './mixins/notice_mixins.js'
+import noticeCell from './components/notice-cell.vue'
+export default {
+	mixins: [noticeMixins],
+	components: {
+		noticeCell
+	},
+	data() {
+		return {
+		}
+	},
+	onLoad(option) {
+		this.initData(option)
+	},
+	methods: {
+		async initData(option) {
+            this.params.messageType = option.messageType
+		    this.getUserAuthClubMessageList()
+		},
+		handleOrderClick(cell) {
+            const link = `${
+                process.env.NODE_ENV === 'development' ? 'http://120.79.25.27:8009/' : 'https://www.caimei365.com/'
+            }page-${cell.thisId}.html`
+            uni.navigateTo({
+                url: `/pages/views/others/web-view?websit=${link}`
+            })
+            this.clearCellNew(cell.id)
+		}
+	},
+	onReachBottom() {
+		if (this.hasNextPage) {
+			this.loadding = true
+			this.pullUpOn = true
+			this.getUserAuthClubMessageList()
+		}
+	},
+	onPullDownRefresh() {
+		//下拉刷新
+		this.listQuery.pageNum = 1
+		this.getUserAuthClubMessageList()
+		uni.stopPullDownRefresh()
+	}
+}
+</script>
+
+<style lang="scss">
+page {
+	background-color: #f7f7f7;
+}
+.container-main {
+	width: 100%;
+	box-sizing: border-box;
+	padding: 24rpx 0;
+	.empty-container {
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        justify-content: center;
+        height: 60vh;
+	}
+    .empty_notice {
+    	width: 290rpx;
+    	height: 230rpx;
+    }
+    .error-text{
+        color: #999999;
+        font-size: 26rpx;
+    }
+}
+.tui-swipeout-content {
+	white-space: normal !important;
+}
+.tui-notice {
+	margin-bottom: 24rpx;
+}
+.tui-notice-cell {
+	width: 702rpx;
+	height: auto;
+	background-color: #ffffff;
+	border-radius: 16rpx;
+	box-sizing: border-box;
+	padding: 16rpx 24rpx;
+	margin: 0 auto;
+	.tui-cell-top {
+		width: 100%;
+		height: 88rpx;
+		line-height: 88rpx;
+		float: left;
+		.cell-title {
+			font-size: 32rpx;
+			color: #333333;
+			float: left;
+			font-weight: bold;
+		}
+		.cell-time {
+			font-size: 24rpx;
+			color: #999999;
+			float: right;
+		}
+	}
+	.tui-cell-content {
+		width: 100%;
+		height: auto;
+		float: left;
+		box-sizing: border-box;
+		border-radius: 8rpx;
+		line-height: 44rpx;
+		padding: 24rpx;
+		background-color: #f7f7f7;
+		font-size: 28rpx;
+		color: #666666;
+		text-align: justify;
+	}
+}
+.tui-custom-btn_box {
+	width: 80px;
+	height: 100%;
+	padding: 0 20rpx;
+	box-sizing: border-box;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	background-color: #f7f7f7;
+}
+
+.tui-custom-btn {
+	width: 56rpx;
+	height: 56rpx;
+	border-radius: 50%;
+	background-color: #f94b4b;
+	color: #ffffff;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	flex-shrink: 0;
+    .deleteImage{
+        width: 56rpx;
+        height: 56rpx;
+    }
+}
+</style>

+ 184 - 0
pages/notice/club/notice-article.vue

@@ -0,0 +1,184 @@
+<template>
+	<view class="container cart clearfix">
+        <tui-skeleton v-if="isRequest" :loadingType="3" :isLoading="true" />
+		<view class="container-main" v-else>
+			<view class="clearfix">
+				<!-- 空白页 -->    
+				<view class="empty-container" v-if="isEmpty">
+					<image mode="aspectFill" class="empty_notice" src="@/static/tabBar/emtry_notice.png"></image>
+					<text class="error-text">暂无任何消息~</text>
+				</view>
+				<!-- 列表 -->
+				<view
+					class="tui-notice"
+					v-else
+					v-for="(cell, index) in dataValue"
+					:key="index"
+					@click.stop="handleOrderClick(cell)"
+				>
+					<tui-swipe-action :operateWidth="80" :backgroundColor="'#F7F7F7'">
+						<template v-slot:content>
+							<notice-cell :cellType="5" :cell="cell"></notice-cell>
+						</template>
+						<template v-slot:button>
+							<view class="tui-custom-btn_box">
+								<view class="tui-custom-btn" @click.stop="deleteBtn(cell.id, index)">
+									<image src="@/static/tabBar/delete_notice.png" class="deleteImage" mode="aspectFill"></image>
+								</view>
+							</view>
+						</template>
+					</tui-swipe-action>
+				</view>
+				<!--加载loadding-->
+                <view v-if="showLoading">
+                    <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
+                    <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore>
+                </view>
+				<!--加载loadding-->
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+import { mapState, mapMutations } from 'vuex'
+import noticeMixins from './mixins/notice_mixins.js'
+import noticeCell from './components/notice-cell.vue'
+export default {
+	mixins: [noticeMixins],
+	components: {
+		noticeCell
+	},
+	data() {
+		return {
+		}
+	},
+	onLoad(option) {
+		this.initData(option)
+	},
+	methods: {
+		async initData(option) {
+            this.params.messageType = option.messageType
+		    this.getUserAuthClubMessageList()
+		},
+		handleOrderClick(cell) {
+            const link = `${
+                process.env.NODE_ENV === 'development' ? 'http://120.79.25.27:8009/' : 'https://www.caimei365.com/'
+            }/info/detail-${cell.thisId}-1.html`
+            uni.navigateTo({
+                url: `/pages/views/others/web-view?websit=${link}`
+            })
+            this.clearCellNew(cell.id)
+		}
+	},
+	onReachBottom() {
+		if (this.hasNextPage) {
+			this.loadding = true
+			this.pullUpOn = true
+			this.getUserAuthClubMessageList()
+		}
+	},
+	onPullDownRefresh() {
+		//下拉刷新
+		this.listQuery.pageNum = 1
+		this.getUserAuthClubMessageList()
+		uni.stopPullDownRefresh()
+	}
+}
+</script>
+
+<style lang="scss">
+page {
+	background-color: #f7f7f7;
+}
+.container-main {
+	width: 100%;
+	box-sizing: border-box;
+	padding: 24rpx 0;
+	.empty-container {
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        justify-content: center;
+        height: 60vh;
+	}
+    .empty_notice {
+    	width: 290rpx;
+    	height: 230rpx;
+    }
+    .error-text{
+        color: #999999;
+        font-size: 26rpx;
+    }
+}
+.tui-swipeout-content {
+	white-space: normal !important;
+}
+.tui-notice {
+	margin-bottom: 24rpx;
+}
+.tui-notice-cell {
+	width: 702rpx;
+	height: auto;
+	background-color: #ffffff;
+	border-radius: 16rpx;
+	box-sizing: border-box;
+	padding: 16rpx 24rpx;
+	margin: 0 auto;
+	.tui-cell-top {
+		width: 100%;
+		height: 88rpx;
+		line-height: 88rpx;
+		float: left;
+		.cell-title {
+			font-size: 32rpx;
+			color: #333333;
+			float: left;
+			font-weight: bold;
+		}
+		.cell-time {
+			font-size: 24rpx;
+			color: #999999;
+			float: right;
+		}
+	}
+	.tui-cell-content {
+		width: 100%;
+		height: auto;
+		float: left;
+		box-sizing: border-box;
+		border-radius: 8rpx;
+		line-height: 44rpx;
+		padding: 24rpx;
+		background-color: #f7f7f7;
+		font-size: 28rpx;
+		color: #666666;
+		text-align: justify;
+	}
+}
+.tui-custom-btn_box {
+	width: 80px;
+	height: 100%;
+	padding: 0 20rpx;
+	box-sizing: border-box;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	background-color: #f7f7f7;
+}
+
+.tui-custom-btn {
+	width: 56rpx;
+	height: 56rpx;
+	border-radius: 50%;
+	background-color: #f94b4b;
+	color: #ffffff;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	flex-shrink: 0;
+    .deleteImage{
+        width: 56rpx;
+        height: 56rpx;
+    }
+}
+</style>

+ 185 - 19
pages/notice/club/notice-coupon.vue

@@ -1,19 +1,185 @@
-<template>
-    <view>
-        优惠促销
-    </view>
-</template>
-
-<script>
-    export default {
-        data() {
-            return {
-                
-            };
-        }
-    }
-</script>
-
-<style lang="scss">
-
-</style>
+<template>
+	<view class="container cart clearfix">
+        <tui-skeleton v-if="isRequest" :loadingType="3" :isLoading="true" />
+		<view class="container-main" v-else>
+			<view class="clearfix">
+				<!-- 空白页 -->    
+				<view class="empty-container" v-if="isEmpty">
+					<image mode="aspectFill" class="empty_notice" src="@/static/tabBar/emtry_notice.png"></image>
+					<text class="error-text">暂无任何消息~</text>
+				</view>
+				<!-- 列表 -->
+				<view
+					class="tui-notice"
+					v-else
+					v-for="(cell, index) in dataValue"
+					:key="index"
+					@click.stop="handleOrderClick(cell)"
+				>
+					<tui-swipe-action :operateWidth="80" :backgroundColor="'#F7F7F7'">
+						<template v-slot:content>
+							<notice-cell :cellType="4" :cell="cell"></notice-cell>
+						</template>
+						<template v-slot:button>
+							<view class="tui-custom-btn_box">
+								<view class="tui-custom-btn" @click.stop="deleteBtn(cell.id, index)">
+									<image src="@/static/tabBar/delete_notice.png" class="deleteImage" mode="aspectFill"></image>
+								</view>
+							</view>
+						</template>
+					</tui-swipe-action>
+				</view>
+				<!--加载loadding-->
+                <view v-if="showLoading">
+                    <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
+                    <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore>
+                </view>
+				<!--加载loadding-->
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+import { mapState, mapMutations } from 'vuex'
+import noticeMixins from './mixins/notice_mixins.js'
+import noticeCell from './components/notice-cell.vue'
+export default {
+	mixins: [noticeMixins],
+	components: {
+		noticeCell
+	},
+	data() {
+		return {
+		}
+	},
+	onLoad(option) {
+		this.initData(option)
+	},
+	methods: {
+		async initData(option) {
+            this.params.messageType = option.messageType
+		    this.getUserAuthClubMessageList()
+		},
+		handleOrderClick(cell) {
+			const linkJumpMap = {
+				1: '/pages/views/coupon/coupon-receive',
+				2: '/pages/views/coupon/coupon-user',
+			}
+			uni.navigateTo({
+			    url: linkJumpMap[cell.couponMessageType]
+			})
+            this.clearCellNew(cell.id)
+		}
+	},
+	onReachBottom() {
+		if (this.hasNextPage) {
+			this.loadding = true
+			this.pullUpOn = true
+			this.getUserAuthClubMessageList()
+		}
+	},
+	onPullDownRefresh() {
+		//下拉刷新
+		this.listQuery.pageNum = 1
+		this.getUserAuthClubMessageList()
+		uni.stopPullDownRefresh()
+	}
+}
+</script>
+
+<style lang="scss">
+page {
+	background-color: #f7f7f7;
+}
+.container-main {
+	width: 100%;
+	box-sizing: border-box;
+	padding: 24rpx 0;
+	.empty-container {
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        justify-content: center;
+        height: 60vh;
+	}
+    .empty_notice {
+    	width: 290rpx;
+    	height: 230rpx;
+    }
+    .error-text{
+        color: #999999;
+        font-size: 26rpx;
+    }
+}
+.tui-swipeout-content {
+	white-space: normal !important;
+}
+.tui-notice {
+	margin-bottom: 24rpx;
+}
+.tui-notice-cell {
+	width: 702rpx;
+	height: auto;
+	background-color: #ffffff;
+	border-radius: 16rpx;
+	box-sizing: border-box;
+	padding: 16rpx 24rpx;
+	margin: 0 auto;
+	.tui-cell-top {
+		width: 100%;
+		height: 88rpx;
+		line-height: 88rpx;
+		float: left;
+		.cell-title {
+			font-size: 32rpx;
+			color: #333333;
+			float: left;
+			font-weight: bold;
+		}
+		.cell-time {
+			font-size: 24rpx;
+			color: #999999;
+			float: right;
+		}
+	}
+	.tui-cell-content {
+		width: 100%;
+		height: auto;
+		float: left;
+		box-sizing: border-box;
+		border-radius: 8rpx;
+		line-height: 44rpx;
+		padding: 24rpx;
+		background-color: #f7f7f7;
+		font-size: 28rpx;
+		color: #666666;
+		text-align: justify;
+	}
+}
+.tui-custom-btn_box {
+	width: 80px;
+	height: 100%;
+	padding: 0 20rpx;
+	box-sizing: border-box;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	background-color: #f7f7f7;
+}
+
+.tui-custom-btn {
+	width: 56rpx;
+	height: 56rpx;
+	border-radius: 50%;
+	background-color: #f94b4b;
+	color: #ffffff;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	flex-shrink: 0;
+    .deleteImage{
+        width: 56rpx;
+        height: 56rpx;
+    }
+}
+</style>

+ 34 - 71
pages/notice/club/notice-order.vue

@@ -1,12 +1,6 @@
 <template>
 <template>
 	<view class="container cart clearfix">
 	<view class="container cart clearfix">
-		<tui-skeleton
-			v-if="skeletonShow"
-			backgroundColor="#fafafa"
-			borderRadius="10rpx"
-			:isLoading="true"
-			:loadingType="5"
-		></tui-skeleton>
+        <tui-skeleton v-if="isRequest" :loadingType="3" :isLoading="true" />
 		<view class="container-main" v-else>
 		<view class="container-main" v-else>
 			<view class="clearfix">
 			<view class="clearfix">
 				<!-- 空白页 -->
 				<!-- 空白页 -->
@@ -18,7 +12,7 @@
 				<view
 				<view
 					class="tui-notice"
 					class="tui-notice"
 					v-else
 					v-else
-					v-for="(cell, index) in list"
+					v-for="(cell, index) in dataValue"
 					:key="index"
 					:key="index"
 					@click.stop="handleOrderClick(cell)"
 					@click.stop="handleOrderClick(cell)"
 				>
 				>
@@ -35,18 +29,20 @@
 						</template>
 						</template>
 					</tui-swipe-action>
 					</tui-swipe-action>
 				</view>
 				</view>
-				<!--加载loadding-->
-				<tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
-				<tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore>
+				<!--加载loadding-->
+                <view v-if="showLoading">
+                    <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
+                    <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore>
+                </view>
 				<!--加载loadding-->
 				<!--加载loadding-->
 			</view>
 			</view>
 		</view>
 		</view>
 	</view>
 	</view>
 </template>
 </template>
 <script>
 <script>
-import { mapState, mapMutations } from 'vuex'
 import noticeMixins from './mixins/notice_mixins.js'
 import noticeMixins from './mixins/notice_mixins.js'
-import noticeCell from './components/notice-cell.vue'
+import noticeCell from './components/notice-cell.vue'
+
 export default {
 export default {
 	mixins: [noticeMixins],
 	mixins: [noticeMixins],
 	components: {
 	components: {
@@ -54,60 +50,36 @@ export default {
 	},
 	},
 	data() {
 	data() {
 		return {
 		return {
-			skeletonShow: true,
-			listQuery: {
-				messageType: 0,
-				pageNum: 1,
-				pageSize: 10
-			},
-			list: [{
-                orderMessageType: 1,
-                time: '2022-01-10',
-                mainImage: '',
-                
-            }],
-			isEmpty: false,
-			loadding: true,
-			pullUpOn: true,
-			pullFlag: true,
-			hasNextPage: false,
-			nomoreText: '上拉显示更多'
 		}
 		}
 	},
 	},
 	onLoad(option) {
 	onLoad(option) {
-        console.log(option)
 		this.initData(option)
 		this.initData(option)
 	},
 	},
 	methods: {
 	methods: {
-		async initData(option) {
-			// const userInfo = await uni.getStorage()
-			// this.listQuery.messageType = option.messageType
-            // console.log(userInfo)
-			// this.listQuery.commonId = userInfo.clubId ? userInfo.clubId : 0
-			// this.getUserAuthClubMessageList()
-            this.skeletonShow = false
+		async initData(option) {
+            this.params.messageType = option.messageType
+			this.getUserAuthClubMessageList()
 		},
 		},
-		handleOrderClick(cell) {
+		handleOrderClick(cell) {
+            this.clearCellNew(cell.id)
 			if (cell.orderMessageType === 1) {
 			if (cell.orderMessageType === 1) {
 				if (this.isOnliyPay(cell)) {
 				if (this.isOnliyPay(cell)) {
-					let payLinkMap = {
-						0: `/pages/user/order/order-pay-list?orderId=${cell.orderId}`,
-						1: `/pages/user/order/order-payunder?orderId=${cell.orderId}`
-					}
-					let linkJumpMap = { 1: payLinkMap[cell.onlinePayFlag] }
 					uni.navigateTo({
 					uni.navigateTo({
-					    url: linkJumpMap[cell.orderMessageType]
+					    url: `/pages/views/order/order-pay?orderId=${cell.orderId}`
 					})
 					})
 				} else {
 				} else {
-					this.$util.msg('订单已完成支付', 2000)
+					uni.showToast({
+					    title: '订单已支付完成',
+                        duration: 1000
+					})
 				}
 				}
 			} else {
 			} else {
 				let linkJumpMap = {
 				let linkJumpMap = {
-					2: `/pages/user/order/order-details?orderId=${cell.orderId}`,
-					3: `/pages/user/order/order-details?orderId=${cell.orderId}`,
-					4: `/pages/user/order/order-details?orderId=${cell.orderId}`,
-					5: `/pages/user/order/order-logistics?orderId=${cell.orderId}`,
-					6: `/pages/user/order/order-details?orderId=${cell.orderId}`
+					2: `/pages/views/order/order-detail?orderId=${cell.orderId}`,
+					3: `/pages/views/order/order-detail?orderId=${cell.orderId}`,
+					4: `/pages/views/order/order-detail?orderId=${cell.orderId}`,
+					5: `/pages/views/order/order-logistics?orderId=${cell.orderId}`,
+					6: `/pages/views/order/order-detail?orderId=${cell.orderId}`
 				}
 				}
 				uni.navigateTo({
 				uni.navigateTo({
 				    url: linkJumpMap[cell.orderMessageType]
 				    url: linkJumpMap[cell.orderMessageType]
@@ -115,35 +87,26 @@ export default {
 			}
 			}
 		},
 		},
 		isOnliyPay(cell){
 		isOnliyPay(cell){
-			let onliyPay = false
 			let statusVal = [11, 12, 13, 21, 22, 23, 111]
 			let statusVal = [11, 12, 13, 21, 22, 23, 111]
-			statusVal.forEach(value => {
-				if (cell.status === value) {
-					onliyPay = true
-				}
-			})
-			return onliyPay
+			return statusVal.includes(cell.status)
 		}
 		}
 	},
 	},
 	onReachBottom() {
 	onReachBottom() {
 		if (this.hasNextPage) {
 		if (this.hasNextPage) {
 			this.loadding = true
 			this.loadding = true
-			this.pullUpOn = true
-			this.getReachBottomData()
-		} else {
-            console.log(111)
-        }
+			this.pullUpOn = true
+            this.showLoading = true
+            this.params.pageNum += 1
+			this.getUserAuthClubMessageList()
+		}
 	},
 	},
 	onPullDownRefresh() {
 	onPullDownRefresh() {
 		//下拉刷新
 		//下拉刷新
-		this.listQuery.pageNum = 1
-		// this.getUserAuthClubMessageList()
+		this.params.pageNum = 1
+        this.dataValue = []
+		this.getUserAuthClubMessageList()
 		uni.stopPullDownRefresh()
 		uni.stopPullDownRefresh()
-	},
-	onShow() {
-        this.skeletonShow = false
-        console.log(this.isEmpty)
-    }
+	}
 }
 }
 </script>
 </script>
 
 

+ 167 - 7
pages/notice/club/notice-server.vue

@@ -1,19 +1,179 @@
 <template>
 <template>
     <view>
     <view>
-        服务通知
+        <tui-skeleton v-if="isRequest" :loadingType="3" :isLoading="true" />
+        <view class="container-main" v-else>
+        	<view class="clearfix">
+        		<!-- 空白页 -->
+        		<view class="empty-container" v-if="isEmpty">
+        			<image mode="aspectFill" class="empty_notice" src="@/static/tabBar/emtry_notice.png"></image>
+        			<text class="error-text">暂无任何消息~</text>
+        		</view>
+        		<!-- 列表 -->
+        		<view
+        			class="tui-notice"
+        			v-else
+        			v-for="(cell, index) in list"
+        			:key="index"
+        			@click.stop="handleOrderClick(cell)"
+        		>
+        			<tui-swipe-action :operateWidth="80" :backgroundColor="'#F7F7F7'">
+        				<template v-slot:content>
+        					<notice-cell :cellType="1" :cell="cell"></notice-cell>
+        				</template>
+        				<template v-slot:button>
+        					<view class="tui-custom-btn_box">
+        						<view class="tui-custom-btn" @click.stop="deleteBtn(cell.id, index)">
+        							<image src="@/static/tabBar/delete_notice.png" class="deleteImage" mode="aspectFill"></image>
+        						</view>
+        					</view>
+        				</template>
+        			</tui-swipe-action>
+        		</view>
+        		<!--加载loadding-->
+        		<!-- <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
+        		<tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore> -->
+        		<!--加载loadding-->
+        	</view>
+        </view>
     </view>
     </view>
 </template>
 </template>
 
 
 <script>
 <script>
-    export default {
-        data() {
-            return {
-                
-            };
-        }
+export default {
+    data() {
+        return {
+            isRequest: false,
+            isEmpty: true
+        };
     }
     }
+}
 </script>
 </script>
 
 
 <style lang="scss">
 <style lang="scss">
+page {
+	background-color: #f7f7f7;
+}
+.container-main {
+	width: 100%;
+	box-sizing: border-box;
+	padding: 24rpx 0;
+    .empty-container {
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        justify-content: center;
+        height: 60vh;
+    }
+	.empty_notice {
+		width: 290rpx;
+		height: 230rpx;
+	}
+    .error-text{
+        color: #999999;
+        font-size: 26rpx;
+    }
+}
+.tui-notice {
+	margin-bottom: 24rpx;
+}
+.tui-notice-cell {
+	width: 702rpx;
+	height: auto;
+	background-color: #ffffff;
+	border-radius: 16rpx;
+	box-sizing: border-box;
+	padding: 16rpx 24rpx;
+	margin: 0 auto;
+	.tui-cell-top {
+		width: 100%;
+		height: 88rpx;
+		line-height: 88rpx;
+		.cell-title {
+			font-size: 32rpx;
+			color: #333333;
+			float: left;
+			font-weight: bold;
+		}
+		.cell-time {
+			font-size: 24rpx;
+			color: #999999;
+			float: right;
+		}
+	}
+	.tui-cell-content {
+		width: 100%;
+		height: 160rpx;
+		box-sizing: border-box;
+		padding: 16rpx;
+		border-radius: 8rpx;
+		background-color: #f7f7f7;
+		.cell-image {
+			width: 128rpx;
+			height: 128rpx;
+			border-radius: 8rpx;
+			float: left;
+			image {
+				width: 128rpx;
+				height: 128rpx;
+				display: block;
+				border-radius: 8rpx;
+			}
+		}
+		.cell-content {
+			width: 490rpx;
+			height: 100%;
+			box-sizing: border-box;
+			padding: 0 20rpx;
+			line-height: 40rpx;
+			font-size: 28rpx;
+			color: #666666;
+			text-align: justify;
+			float: left;
+		}
+	}
+	.tui-cell-bot {
+		width: 100%;
+		height: 80rpx;
+		box-sizing: border-box;
+		padding: 16rpx 0 0 0;
+		.tui-cell-btn {
+			width: 160rpx;
+			height: 64rpx;
+			border-radius: 35rpx;
+			box-sizing: border-box;
+			border: 1px solid #999999;
+			text-align: center;
+			line-height: 64rpx;
+			font-size: 26rpx;
+			color: #333333;
+			float: right;
+			margin-left: 24rpx;
+		}
+	}
+}
+.tui-custom-btn_box {
+	width: 80px;
+	height: 100%;
+	box-sizing: border-box;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	background-color: #f7f7f7;
+}
 
 
+.tui-custom-btn {
+	width: 56rpx;
+	height: 56rpx;
+	border-radius: 50%;
+	background-color: #f94b4b;
+	color: #ffffff;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	flex-shrink: 0;
+    .deleteImage{
+        width: 56rpx;
+        height: 56rpx;
+    }
+}
 </style>
 </style>

+ 167 - 7
pages/notice/club/notice-users.vue

@@ -1,19 +1,179 @@
 <template>
 <template>
     <view>
     <view>
-        账户通知
+        <tui-skeleton v-if="isRequest" :loadingType="3" :isLoading="true" />
+        <view class="container-main" v-else>
+        	<view class="clearfix">
+        		<!-- 空白页 -->
+        		<view class="empty-container" v-if="isEmpty">
+        			<image mode="aspectFill" class="empty_notice" src="@/static/tabBar/emtry_notice.png"></image>
+        			<text class="error-text">暂无任何消息~</text>
+        		</view>
+        		<!-- 列表 -->
+        		<view
+        			class="tui-notice"
+        			v-else
+        			v-for="(cell, index) in list"
+        			:key="index"
+        			@click.stop="handleOrderClick(cell)"
+        		>
+        			<tui-swipe-action :operateWidth="80" :backgroundColor="'#F7F7F7'">
+        				<template v-slot:content>
+        					<notice-cell :cellType="1" :cell="cell"></notice-cell>
+        				</template>
+        				<template v-slot:button>
+        					<view class="tui-custom-btn_box">
+        						<view class="tui-custom-btn" @click.stop="deleteBtn(cell.id, index)">
+        							<image src="@/static/tabBar/delete_notice.png" class="deleteImage" mode="aspectFill"></image>
+        						</view>
+        					</view>
+        				</template>
+        			</tui-swipe-action>
+        		</view>
+        		<!--加载loadding-->
+        		<!-- <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
+        		<tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore> -->
+        		<!--加载loadding-->
+        	</view>
+        </view>
     </view>
     </view>
 </template>
 </template>
 
 
 <script>
 <script>
-    export default {
-        data() {
-            return {
-                
-            };
-        }
+export default {
+    data() {
+        return {
+            isRequest: false,
+            isEmpty: true
+        };
     }
     }
+}
 </script>
 </script>
 
 
 <style lang="scss">
 <style lang="scss">
+page {
+	background-color: #f7f7f7;
+}
+.container-main {
+	width: 100%;
+	box-sizing: border-box;
+	padding: 24rpx 0;
+    .empty-container {
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        justify-content: center;
+        height: 60vh;
+    }
+	.empty_notice {
+		width: 290rpx;
+		height: 230rpx;
+	}
+    .error-text{
+        color: #999999;
+        font-size: 26rpx;
+    }
+}
+.tui-notice {
+	margin-bottom: 24rpx;
+}
+.tui-notice-cell {
+	width: 702rpx;
+	height: auto;
+	background-color: #ffffff;
+	border-radius: 16rpx;
+	box-sizing: border-box;
+	padding: 16rpx 24rpx;
+	margin: 0 auto;
+	.tui-cell-top {
+		width: 100%;
+		height: 88rpx;
+		line-height: 88rpx;
+		.cell-title {
+			font-size: 32rpx;
+			color: #333333;
+			float: left;
+			font-weight: bold;
+		}
+		.cell-time {
+			font-size: 24rpx;
+			color: #999999;
+			float: right;
+		}
+	}
+	.tui-cell-content {
+		width: 100%;
+		height: 160rpx;
+		box-sizing: border-box;
+		padding: 16rpx;
+		border-radius: 8rpx;
+		background-color: #f7f7f7;
+		.cell-image {
+			width: 128rpx;
+			height: 128rpx;
+			border-radius: 8rpx;
+			float: left;
+			image {
+				width: 128rpx;
+				height: 128rpx;
+				display: block;
+				border-radius: 8rpx;
+			}
+		}
+		.cell-content {
+			width: 490rpx;
+			height: 100%;
+			box-sizing: border-box;
+			padding: 0 20rpx;
+			line-height: 40rpx;
+			font-size: 28rpx;
+			color: #666666;
+			text-align: justify;
+			float: left;
+		}
+	}
+	.tui-cell-bot {
+		width: 100%;
+		height: 80rpx;
+		box-sizing: border-box;
+		padding: 16rpx 0 0 0;
+		.tui-cell-btn {
+			width: 160rpx;
+			height: 64rpx;
+			border-radius: 35rpx;
+			box-sizing: border-box;
+			border: 1px solid #999999;
+			text-align: center;
+			line-height: 64rpx;
+			font-size: 26rpx;
+			color: #333333;
+			float: right;
+			margin-left: 24rpx;
+		}
+	}
+}
+.tui-custom-btn_box {
+	width: 80px;
+	height: 100%;
+	box-sizing: border-box;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	background-color: #f7f7f7;
+}
 
 
+.tui-custom-btn {
+	width: 56rpx;
+	height: 56rpx;
+	border-radius: 50%;
+	background-color: #f94b4b;
+	color: #ffffff;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	flex-shrink: 0;
+    .deleteImage{
+        width: 56rpx;
+        height: 56rpx;
+    }
+}
 </style>
 </style>

+ 375 - 373
pages/tabBar/home/home.vue

@@ -1,373 +1,375 @@
-<template>
-    <view class="container">
-        <tui-skeleton v-if="isRequest" :loadingType="3" :isLoading="true"></tui-skeleton>
-        <!-- 首页自定义导航栏 -->
-        <view class="search-input sticky-top">
-            <view class="search-content" @click="handleToSearch">
-                <text class="iconfont icon-sousuo"></text>
-                <view class="search-text">搜索商品</view>
-            </view>
-        </view>
-        <!-- 轮播图 -->
-        <cm-banner
-            :list="bannerList"
-            :current="current"
-            :autoplay="autoplay"
-            @change="index => (current = index)"
-            @click="onSwiperClick"
-        ></cm-banner>
-
-        <!-- 金刚区菜单 -->
-        <cm-navbar :modal="navbarList" @click="onNavbarClick"></cm-navbar>
-
-        <!-- 加入我们 -->
-        <view class="grid"></view>
-        <view class="join-us">
-            <image :src="staticUrl + 'icon-join-us.png'" class="join-icon"></image>
-            <view class="join-content">
-                <view class="join-label-title">颜选美学福利群</view>
-                <view class="join-label-text">进群第一时间得知优惠福利!</view>
-            </view>
-            <view class="join-button" @click="handleJoinUs">加入我们</view>
-        </view>
-        <view class="grid"></view>
-
-        <!-- 优惠券专区 -->
-        <view class="coupon-area" v-if="couponList.length > 0">
-            <cm-floor-title title="优惠券专区" @click="onMoreCoupon"></cm-floor-title>
-            <cm-coupon-area :couponList="couponList" @click="onCouponClick"></cm-coupon-area>
-        </view>
-
-        <!-- 楼层区域 -->
-        <view class="cm-floor" v-for="floorData in floorList" :key="floorData.id">
-            <cm-floor-template
-                :floorData="floorData"
-                @onBannerClick="onBannerClick"
-                @more="onMoreProduct"
-            ></cm-floor-template>
-        </view>
-
-        <!-- 优惠券活动弹窗 -->
-        <cm-active-alert></cm-active-alert>
-
-        <!-- 返回顶部 -->
-        <tui-scroll-top
-            :scrollTop="scrollTop"
-            :isShare="true"
-            :bottom="60"
-            :customShare="true"
-            @share="onShare"
-        ></tui-scroll-top>
-
-        <!-- 分享弹窗 -->
-        <cm-share-popup ref="sharePopup" :data="posterData" type="normal"></cm-share-popup>
-    </view>
-</template>
-
-<script>
-import { fetchHomeCarousel, fetchHomeNavbar, fetchHomeFloorData, fetchHomeCouponList } from '@/services/api/home.js'
-import { fetchCouponDisplay } from '@/services/api/coupon.js'
-import { shareDataResult } from '@/common/share.helper.js'
-import { mapActions, mapGetters } from 'vuex'
-import { queryStringify } from '@/common/utils.js'
-
-export default {
-    data() {
-        return {
-            isRequest: true,
-            bannerData: [],
-            navbarList: [],
-            floorInfo: {},
-            floorList: [],
-            couponList: [],
-            hasCouponWillReceive: false,
-            current: 0,
-            isRefresh: false,
-            couponTipStr: '',
-            scrollTop: 0,
-            posterData: {},
-            autoplay: true
-        }
-    },
-    computed: {
-        ...mapGetters(['userId']),
-        bannerList() {
-            return this.bannerData.map(item => item.image)
-        }
-    },
-    onPageScroll(e) {
-        this.scrollTop = e.scrollTop
-    },
-    onPullDownRefresh() {
-        this.initHomeInfo()
-    },
-    onShareAppMessage() {
-        // 加密
-        const state_str = encodeURIComponent(this.$crypto.encrypt({ type: 0 }))
-        return {
-            title: '护肤上颜选,正品有好货~',
-            path: `/pages/index/index?state_str=${state_str}`,
-            imageUrl: this.staticUrl + 'icon-share.png'
-        }
-    },
-    onShow() {
-        this.checkCouponAlert()
-        this.fetchCartKindCount() // 购物车商品数量
-        this.fetchCouponList()
-        this.autoplay = true
-    },
-    onHide() {
-        this.autoplay = false
-        this.$refs.sharePopup.close()
-    },
-    onLoad() {
-        this.initHomeInfo()
-    },
-    methods: {
-        ...mapActions('cart', ['fetchCartKindCount']),
-        ...mapActions('coupon', ['checkCouponAlert']),
-
-        // 初始化首页信息
-        initHomeInfo() {
-            this.fetchCarousel()
-            this.fetchNavbar()
-            this.fetchFloorData()
-            // this.fetchCouponList()
-        },
-
-        // 搜索
-        handleToSearch() {
-            this.$router.navigateTo('goods/goods-search')
-        },
-
-        // 金刚区菜单导航
-        onNavbarClick(navbar) {
-            this.$setStorage('NAVBAR', { type: 'navbar', id: navbar.id, title: navbar.name })
-            this.$router.navigateTo('goods/goods-list')
-        },
-
-        // 更多优惠券
-        onMoreCoupon() {
-            this.$router.navigateTo('coupon/coupon-receive')
-        },
-
-        // 优惠券点击(领取)
-        onCouponClick(couponData) {
-            const coupon = { ...couponData }
-            if (coupon.controlType === 'receive') {
-                const index = this.couponList.findIndex(item => item.couponId === coupon.couponId)
-                this.couponList.splice(index, 1)
-                coupon.controlType = 'use'
-                this.$set(this.couponList, index, coupon)
-            }
-        },
-
-        // 商品楼层banner点击事件
-        onBannerClick(banner) {
-            console.log(banner)
-            this.jumpAction(banner)
-        },
-
-        // 更多商品
-        onMoreProduct(floor) {
-            this.$setStorage('NAVBAR', { type: 'floor', id: floor.id, title: floor.title })
-            this.$router.navigateTo('goods/goods-list')
-        },
-
-        // 加入我们
-        handleJoinUs() {
-            this.$router.navigateTo('others/join-us')
-        },
-
-        // 轮播图跳转
-        onSwiperClick(index) {
-            this.jumpAction(this.bannerData[index])
-        },
-
-        // 获取轮播图列表
-        async fetchCarousel() {
-            try {
-                const resultCarousel = await fetchHomeCarousel() // 轮播图
-
-                this.bannerData = resultCarousel.data
-            } catch (e) {
-                console.log('获取轮播图列表失败')
-            }
-        },
-
-        // 获取金刚区菜单
-        async fetchNavbar() {
-            try {
-                const resultNavbar = await fetchHomeNavbar() // 轮播图
-                this.navbarList = resultNavbar.data
-            } catch (e) {
-                console.log('获取金刚区菜单失败')
-            }
-        },
-
-        // 获取楼层信息
-        async fetchFloorData() {
-            try {
-                const resultFloorData = await fetchHomeFloorData({ userId: this.userId }) // 商品楼层信息
-                this.floorInfo = resultFloorData.data.page
-                this.floorList = resultFloorData.data.floorList
-                // 楼层信息加载成功
-                this.isRequest = false
-                uni.stopPullDownRefresh()
-            } catch (e) {
-                console.log('获取楼层信息失败')
-            }
-        },
-
-        // 获取优惠券列表
-        async fetchCouponList() {
-            try {
-                await this.fetchCouponDisplay() // 获取可领取优惠券类型
-                const resultCouponData = await fetchHomeCouponList({ userId: this.userId })
-                this.hasCouponWillReceive = resultCouponData.data && resultCouponData.data.length > 0
-                this.couponList = [
-                    ...resultCouponData.data.map(item => {
-                        item.controlType = 'receive'
-                        return item
-                    }),
-                    ...this.generateCouponTips()
-                ]
-            } catch (e) {
-                console.log('获取优惠券列表失败')
-            }
-        },
-
-        // 获取可领取优惠券类型
-        async fetchCouponDisplay() {
-            try {
-                const res = await fetchCouponDisplay({ userId: this.userId })
-                this.couponTipStr = res.data
-                return res
-            } catch (e) {
-                console.log('获取优惠券类型失败')
-                return e
-            }
-        },
-
-        // 生成优惠券说明
-        generateCouponTips() {
-            const result = [
-                {
-                    type: 'tip',
-                    id: 1,
-                    name: '好友邀请券福利'
-                },
-                {
-                    type: 'tip',
-                    id: 2,
-                    name: '好友消费券福利'
-                },
-                {
-                    type: 'tip',
-                    id: 3,
-                    name: '分享券福利'
-                }
-            ]
-            return result.filter(item => this.couponTipStr.indexOf(item.id.toString()) > -1)
-        },
-
-        // 分享
-        onShare() {
-            this.posterData = { query: queryStringify({ type: 0 }) }
-            this.$refs.sharePopup.open()
-        }
-    }
-}
-</script>
-
-<style lang="scss" scoped>
-.grid {
-    height: 24rpx;
-    background-color: #f7f7f7;
-}
-
-.container {
-    min-height: 100vh;
-    background: url(https://static.caimei365.com/app/mini-hehe/icon/icon-index-bg.png) no-repeat top center;
-    background-size: 750rpx auto;
-    background-position-y: -220rpx;
-
-    .search-input {
-        width: 100%;
-        padding: 24rpx;
-        box-sizing: border-box;
-        background: linear-gradient(180deg, #fa55bf 0%, #f8458b 100%);
-
-        .search-content {
-            @extend .cm-flex-center;
-            justify-content: flex-start;
-            width: 702rpx;
-            height: 66rpx;
-            border-radius: 33rpx;
-            color: #8a8a8a;
-            background: #fff;
-            box-sizing: border-box;
-            padding: 0 24rpx;
-            .iconfont {
-                font-size: 34rpx;
-                margin-right: 12rpx;
-            }
-            .search-text {
-                font-size: 24rpx;
-            }
-        }
-    }
-
-    // 加入我们
-    .join-us {
-        @extend .cm-flex-between;
-        padding: 24rpx;
-        background-color: #fff;
-
-        .join-icon {
-            width: 136rpx;
-            height: 136rpx;
-            display: block;
-        }
-
-        .join-content {
-            @extend .cm-flex-center;
-            flex-direction: column;
-            align-items: flex-start;
-
-            .join-label-title {
-                font-size: 30rpx;
-                font-weight: bold;
-                color: #333333;
-                margin-bottom: 24rpx;
-            }
-            .join-label-text {
-                font-size: 24rpx;
-                color: #333333;
-            }
-        }
-        .join-button {
-            width: 136rpx;
-            height: 56rpx;
-
-            text-align: center;
-            line-height: 56rpx;
-            font-size: 26rpx;
-            font-weight: 400;
-            color: #ffffff;
-
-            background: #ff457b;
-            border-radius: 8rpx;
-        }
-    }
-
-    // 优惠券专区
-    .coupon-area {
-        padding-top: 24rpx;
-    }
-
-    .cm-floor {
-        margin-bottom: 60rpx;
-    }
-}
-</style>
+<template>
+    <view class="container">
+        <tui-skeleton v-if="isRequest" :loadingType="3" :isLoading="true"></tui-skeleton>
+        <!-- 首页自定义导航栏 -->
+        <view class="search-input sticky-top">
+            <view class="search-content" @click="handleToSearch">
+                <text class="iconfont icon-sousuo"></text>
+                <view class="search-text">搜索商品</view>
+            </view>
+        </view>
+        <!-- 轮播图 -->
+        <cm-banner
+            :list="bannerList"
+            :current="current"
+            :autoplay="autoplay"
+            @change="index => (current = index)"
+            @click="onSwiperClick"
+        ></cm-banner>
+
+        <!-- 金刚区菜单 -->
+        <cm-navbar :modal="navbarList" @click="onNavbarClick"></cm-navbar>
+
+        <!-- 加入我们 -->
+        <view class="grid"></view>
+        <view class="join-us">
+            <image :src="staticUrl + 'icon-join-us.png'" class="join-icon"></image>
+            <view class="join-content">
+                <view class="join-label-title">颜选美学福利群</view>
+                <view class="join-label-text">进群第一时间得知优惠福利!</view>
+            </view>
+            <view class="join-button" @click="handleJoinUs">加入我们</view>
+        </view>
+        <view class="grid"></view>
+
+        <!-- 优惠券专区 -->
+        <view class="coupon-area" v-if="couponList.length > 0">
+            <cm-floor-title title="优惠券专区" @click="onMoreCoupon"></cm-floor-title>
+            <cm-coupon-area :couponList="couponList" @click="onCouponClick"></cm-coupon-area>
+        </view>
+
+        <!-- 楼层区域 -->
+        <view class="cm-floor" v-for="floorData in floorList" :key="floorData.id">
+            <cm-floor-template
+                :floorData="floorData"
+                @onBannerClick="onBannerClick"
+                @more="onMoreProduct"
+            ></cm-floor-template>
+        </view>
+
+        <!-- 优惠券活动弹窗 -->
+        <cm-active-alert></cm-active-alert>
+
+        <!-- 返回顶部 -->
+        <tui-scroll-top
+            :scrollTop="scrollTop"
+            :isShare="true"
+            :bottom="60"
+            :customShare="true"
+            @share="onShare"
+        ></tui-scroll-top>
+
+        <!-- 分享弹窗 -->
+        <cm-share-popup ref="sharePopup" :data="posterData" type="normal"></cm-share-popup>
+    </view>
+</template>
+
+<script>
+import { fetchHomeCarousel, fetchHomeNavbar, fetchHomeFloorData, fetchHomeCouponList } from '@/services/api/home.js'
+import { fetchCouponDisplay } from '@/services/api/coupon.js'
+import { shareDataResult } from '@/common/share.helper.js'
+import { mapActions, mapGetters } from 'vuex'
+import { queryStringify } from '@/common/utils.js'
+
+export default {
+    data() {
+        return {
+            isRequest: true,
+            bannerData: [],
+            navbarList: [],
+            floorInfo: {},
+            floorList: [],
+            couponList: [],
+            hasCouponWillReceive: false,
+            current: 0,
+            isRefresh: false,
+            couponTipStr: '',
+            scrollTop: 0,
+            posterData: {},
+            autoplay: true
+        }
+    },
+    computed: {
+        ...mapGetters(['userId']),
+        bannerList() {
+            return this.bannerData.map(item => item.image)
+        }
+    },
+    onPageScroll(e) {
+        this.scrollTop = e.scrollTop
+    },
+    onPullDownRefresh() {
+        this.initHomeInfo()
+    },
+    onShareAppMessage() {
+        // 加密
+        const state_str = encodeURIComponent(this.$crypto.encrypt({ type: 0 }))
+        return {
+            title: '护肤上颜选,正品有好货~',
+            path: `/pages/index/index?state_str=${state_str}`,
+            imageUrl: this.staticUrl + 'icon-share.png'
+        }
+    },
+    onShow() {
+        this.checkCouponAlert()
+        this.fetchCartKindCount() // 购物车商品数量
+        this.fetchCouponList()
+        this.updateNoticeNum() // 消息通知数量
+        this.autoplay = true
+    },
+    onHide() {
+        this.autoplay = false
+        this.$refs.sharePopup.close()
+    },
+    onLoad() {
+        this.initHomeInfo()
+    },
+    methods: {
+        ...mapActions('cart', ['fetchCartKindCount']),
+        ...mapActions('coupon', ['checkCouponAlert']),
+        ...mapActions('user', ['updateNoticeNum']),
+
+        // 初始化首页信息
+        initHomeInfo() {
+            this.fetchCarousel()
+            this.fetchNavbar()
+            this.fetchFloorData()
+            // this.fetchCouponList()
+        },
+
+        // 搜索
+        handleToSearch() {
+            this.$router.navigateTo('goods/goods-search')
+        },
+
+        // 金刚区菜单导航
+        onNavbarClick(navbar) {
+            this.$setStorage('NAVBAR', { type: 'navbar', id: navbar.id, title: navbar.name })
+            this.$router.navigateTo('goods/goods-list')
+        },
+
+        // 更多优惠券
+        onMoreCoupon() {
+            this.$router.navigateTo('coupon/coupon-receive')
+        },
+
+        // 优惠券点击(领取)
+        onCouponClick(couponData) {
+            const coupon = { ...couponData }
+            if (coupon.controlType === 'receive') {
+                const index = this.couponList.findIndex(item => item.couponId === coupon.couponId)
+                this.couponList.splice(index, 1)
+                coupon.controlType = 'use'
+                this.$set(this.couponList, index, coupon)
+            }
+        },
+
+        // 商品楼层banner点击事件
+        onBannerClick(banner) {
+            console.log(banner)
+            this.jumpAction(banner)
+        },
+
+        // 更多商品
+        onMoreProduct(floor) {
+            this.$setStorage('NAVBAR', { type: 'floor', id: floor.id, title: floor.title })
+            this.$router.navigateTo('goods/goods-list')
+        },
+
+        // 加入我们
+        handleJoinUs() {
+            this.$router.navigateTo('others/join-us')
+        },
+
+        // 轮播图跳转
+        onSwiperClick(index) {
+            this.jumpAction(this.bannerData[index])
+        },
+
+        // 获取轮播图列表
+        async fetchCarousel() {
+            try {
+                const resultCarousel = await fetchHomeCarousel() // 轮播图
+
+                this.bannerData = resultCarousel.data
+            } catch (e) {
+                console.log('获取轮播图列表失败')
+            }
+        },
+
+        // 获取金刚区菜单
+        async fetchNavbar() {
+            try {
+                const resultNavbar = await fetchHomeNavbar() // 轮播图
+                this.navbarList = resultNavbar.data
+            } catch (e) {
+                console.log('获取金刚区菜单失败')
+            }
+        },
+
+        // 获取楼层信息
+        async fetchFloorData() {
+            try {
+                const resultFloorData = await fetchHomeFloorData({ userId: this.userId }) // 商品楼层信息
+                this.floorInfo = resultFloorData.data.page
+                this.floorList = resultFloorData.data.floorList
+                // 楼层信息加载成功
+                this.isRequest = false
+                uni.stopPullDownRefresh()
+            } catch (e) {
+                console.log('获取楼层信息失败')
+            }
+        },
+
+        // 获取优惠券列表
+        async fetchCouponList() {
+            try {
+                await this.fetchCouponDisplay() // 获取可领取优惠券类型
+                const resultCouponData = await fetchHomeCouponList({ userId: this.userId })
+                this.hasCouponWillReceive = resultCouponData.data && resultCouponData.data.length > 0
+                this.couponList = [
+                    ...resultCouponData.data.map(item => {
+                        item.controlType = 'receive'
+                        return item
+                    }),
+                    ...this.generateCouponTips()
+                ]
+            } catch (e) {
+                console.log('获取优惠券列表失败')
+            }
+        },
+
+        // 获取可领取优惠券类型
+        async fetchCouponDisplay() {
+            try {
+                const res = await fetchCouponDisplay({ userId: this.userId })
+                this.couponTipStr = res.data
+                return res
+            } catch (e) {
+                console.log('获取优惠券类型失败')
+                return e
+            }
+        },
+
+        // 生成优惠券说明
+        generateCouponTips() {
+            const result = [
+                {
+                    type: 'tip',
+                    id: 1,
+                    name: '好友邀请券福利'
+                },
+                {
+                    type: 'tip',
+                    id: 2,
+                    name: '好友消费券福利'
+                },
+                {
+                    type: 'tip',
+                    id: 3,
+                    name: '分享券福利'
+                }
+            ]
+            return result.filter(item => this.couponTipStr.indexOf(item.id.toString()) > -1)
+        },
+
+        // 分享
+        onShare() {
+            this.posterData = { query: queryStringify({ type: 0 }) }
+            this.$refs.sharePopup.open()
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.grid {
+    height: 24rpx;
+    background-color: #f7f7f7;
+}
+
+.container {
+    min-height: 100vh;
+    background: url(https://static.caimei365.com/app/mini-hehe/icon/icon-index-bg.png) no-repeat top center;
+    background-size: 750rpx auto;
+    background-position-y: -220rpx;
+
+    .search-input {
+        width: 100%;
+        padding: 24rpx;
+        box-sizing: border-box;
+        background: linear-gradient(180deg, #fa55bf 0%, #f8458b 100%);
+
+        .search-content {
+            @extend .cm-flex-center;
+            justify-content: flex-start;
+            width: 702rpx;
+            height: 66rpx;
+            border-radius: 33rpx;
+            color: #8a8a8a;
+            background: #fff;
+            box-sizing: border-box;
+            padding: 0 24rpx;
+            .iconfont {
+                font-size: 34rpx;
+                margin-right: 12rpx;
+            }
+            .search-text {
+                font-size: 24rpx;
+            }
+        }
+    }
+
+    // 加入我们
+    .join-us {
+        @extend .cm-flex-between;
+        padding: 24rpx;
+        background-color: #fff;
+
+        .join-icon {
+            width: 136rpx;
+            height: 136rpx;
+            display: block;
+        }
+
+        .join-content {
+            @extend .cm-flex-center;
+            flex-direction: column;
+            align-items: flex-start;
+
+            .join-label-title {
+                font-size: 30rpx;
+                font-weight: bold;
+                color: #333333;
+                margin-bottom: 24rpx;
+            }
+            .join-label-text {
+                font-size: 24rpx;
+                color: #333333;
+            }
+        }
+        .join-button {
+            width: 136rpx;
+            height: 56rpx;
+
+            text-align: center;
+            line-height: 56rpx;
+            font-size: 26rpx;
+            font-weight: 400;
+            color: #ffffff;
+
+            background: #ff457b;
+            border-radius: 8rpx;
+        }
+    }
+
+    // 优惠券专区
+    .coupon-area {
+        padding-top: 24rpx;
+    }
+
+    .cm-floor {
+        margin-bottom: 60rpx;
+    }
+}
+</style>

+ 308 - 242
pages/tabBar/notice/notice.vue

@@ -1,243 +1,309 @@
-<template>
-    <view class="notice clearfix" :style="{ paddingTop: CustomBar + 'px' }">
-        <tui-skeleton
-        	v-if="skeletonShow"
-        	backgroundColor="#fafafa"
-        	borderRadius="10rpx"
-        	:isLoading="true"
-        	:loadingType="5"
-        ></tui-skeleton>
-        <view v-else>
-            <view class="navbar-wrap" :style="{ height: CustomBar + 'px', paddingTop: StatusBar + 'px' }">
-            	<view
-            		class="navbar-text"
-            		:style="{ lineHeight: CustomBar - StatusBar + 'px;', fontSize: fontSizeSetting + 'px;' }"
-            	>
-            		消息 <image class="iconfont icon-qingli" @click="clearNews" src="@/static/tabBar/clean_notice.png"></image>
-            	</view>
-            </view>
-            <view class="container-notice">
-                <view class="notice-cell" @click="navigateTo('/pages/notice/club/notice-order?messageType=1')">
-                	<view class="notice-cell-icon">
-                		<image class="icon-image" src="@/static/tabBar/play_notice.png" mode=""></image>
-                	</view>
-                	<view class="notice-cell-text"> 交易物流 <text class="cell-text">官方</text> </view>
-                	<view class="notice-cell-badge" v-if="tradeCount > 0">
-                		<text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num">
-                			{{ tradeCount | BadgeType }}
-                		</text>
-                	</view>
-                </view>
-                <view class="notice-cell" @click="navigateTo('/pages/notice/club/notice-users?messageType=2')">
-                	<view class="notice-cell-icon">
-                		<image class="icon-image" src="@/static/tabBar/user_notice.png" mode=""></image>
-                	</view>
-                	<view class="notice-cell-text"> 账户通知 <text class="cell-text">官方</text> </view>
-                	<view class="notice-cell-badge" v-if="accountCount > 0">
-                		<text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num">
-                			{{ accountCount | BadgeType }}
-                		</text>
-                	</view>
-               </view>
-               <view class="notice-cell" @click="navigateTo('/pages/notice/club/notice-server?messageType=3')">
-                	<view class="notice-cell-icon">
-                		<image class="icon-image" src="@/static/tabBar/server_notice.png" mode=""></image>
-                	</view>
-                	<view class="notice-cell-text"> 服务通知 <text class="cell-text">官方</text> </view>
-                	<view class="notice-cell-badge" v-if="notificationCount > 0">
-                		<text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num">
-                			{{ notificationCount | BadgeType }}
-                		</text>
-                	</view>
-                </view>
-                <view class="notice-cell" @click="navigateTo('/pages/notice/club/notice-coupon?messageType=4')">
-                	<view class="notice-cell-icon">
-                		<image class="icon-image" src="@/static/tabBar/preferential_notice.png" mode=""></image>
-                	</view>
-                	<view class="notice-cell-text"> 优惠促销 <text class="cell-text">官方</text> </view>
-                	<view class="notice-cell-badge" v-if="promotionCount > 0">
-                		<text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num">
-                			{{ promotionCount | BadgeType }}
-                		</text>
-                	</view>
-                </view>
-            </view>
-        </view>
-    </view>
-</template>
-
-<script>
-    import { mapGetters, mapMutations } from 'vuex'
-    export default {
-        data() {
-            return {
-                skeletonShow: true,
-                // CustomBar: this.CustomBar,
-                // StatusBar: this.StatusBar,
-                // fontSizeSetting: this.fontSizeSetting,
-                CustomBar: '',
-                StatusBar: '',
-                fontSizeSetting: '',
-                StaticUrl: '',
-                clubId: 0,
-                allCount:0,
-                tradeCount: 0,
-                accountCount: 0,
-                notificationCount: 0,
-                promotionCount: 0
-            }
-        },
-        filters: {
-            BadgeType: (val) => (val && val >= 99 ? '99+' : val), // 红点的提示信息
-        },
-        computed: {
-            ...mapGetters(['hasLogin'])
-        },
-        watch: {},
-        onPullDownRefresh() {
-            uni.stopPullDownRefresh()
-        },
-        onShow() {
-            console.log(this.hasLogin)
-            if (this.hasLogin) {
-            	this.initData()
-            } else {
-            	this.initLogin()
-            }
-        },
-        methods: {
-            initLogin() {
-                console.log(111)
-                uni.redirectTo({ url: '/pages/authorize/login-custom' })
-            },
-            initData() {
-                this.skeletonShow = false
-                this.getSystomInfo()
-            },
-            getSystomInfo() {
-                uni.getSystemInfo({
-                    success: (e) => {
-                        if (e.platform == 'android') {
-                            this.CustomBar = e.statusBarHeight + 50
-                        } else {
-                            this.CustomBar = e.statusBarHeight + 45
-                        };
-                        this.StatusBar = e.statusBarHeight
-                        this.fontSizeSetting = e.fontSizeSetting
-                    }
-                })
-            },
-            navigateTo(url) {
-                uni.navigateTo({
-                    url: url,
-                })
-            },
-        },
-    }
-</script>
-
-<style lang="scss">
-.navbar-wrap {
-	position: fixed;
-	width: 100%;
-	top: 0;
-	z-index: 100000;
-	box-sizing: border-box;
-	background: #ffffff;
-	.navbar-text {
-		font-size: 30rpx;
-		color: #000000;
-		font-weight: 500;
-		text-align: center;
-		.iconfont {
-			display: inline-block;
-			width: 48rpx;
-			height: 48rpx;
-			border-radius: 50%;
-			background-color: #f5f5f5;
-			text-align: center;
-			line-height: 48rpx;
-			color: #666666;
-			font-size: 30rpx;
-			margin-left: 20rpx;
-		}
-	}
-}
-.container-notice {
-	width: 100%;
-	height: auto;
-	box-sizing: border-box;
-	padding: 0 24rpx;
-	padding-top: 20rpx;
-	.notice-cell {
-		width: 100%;
-		height: 130rpx;
-		box-sizing: border-box;
-		padding: 19rpx 0;
-		border-bottom: 1px solid #e1e1e1;
-		.notice-cell-icon {
-			width: 92rpx;
-			height: 92rpx;
-			float: left;
-			.icon-image {
-				width: 92rpx;
-				height: 92rpx;
-				display: block;
-			}
-		}
-		.notice-cell-text {
-			width: 400rpx;
-			height: 100%;
-			line-height: 92rpx;
-			font-size: 34rpx;
-			text-align: left;
-			margin-left: 24rpx;
-			float: left;
-			.cell-text {
-				display: inline-block;
-				height: 32rpx;
-				padding: 0 11rpx;
-				line-height: 32rpx;
-				border-radius: 20rpx;
-				text-align: center;
-				border: 1px solid #e15616;
-				font-size: 24rpx;
-				color: #e15616;
-				margin-left: 10rpx;
-			}
-		}
-		.notice-cell-badge {
-			width: 92rpx;
-			height: 92rpx;
-			float: right;
-			box-sizing: border-box;
-			padding: 25rpx 15rpx;
-			text-align: right;
-		}
-	}
-}
-.uni-badge--small {
-	-webkit-transform: scale(0.8);
-	-ms-transform: scale(0.8);
-	transform: scale(0.8);
-	-webkit-transform-origin: center center;
-	-ms-transform-origin: center center;
-	transform-origin: center center;
-}
-.uni-badge {
-	font-family: 'Helvetica Neue', Helvetica, sans-serif;
-	-webkit-box-sizing: border-box;
-	box-sizing: border-box;
-	font-size: 12px;
-	line-height: 1;
-	display: inline-block;
-	padding: 3px 6px;
-	color: #333;
-	border-radius: 100px;
-	background-color: #f1f1f1;
-}
-.uni-badge-error {
-	color: #fff;
-	background-color: #ff2a2a;
-}
+<template>
+    <view class="notice clearfix" :style="{ paddingTop: CustomBar + 'px' }">
+        <tui-skeleton
+            v-if="skeletonShow"
+            backgroundColor="#fafafa"
+            borderRadius="10rpx"
+            :isLoading="true"
+            :loadingType="5"
+        ></tui-skeleton>
+        <view v-else>
+            <view class="navbar-wrap" :style="{ height: CustomBar + 'px', paddingTop: StatusBar + 'px' }">
+                <view
+                    class="navbar-text"
+                    :style="{ lineHeight: CustomBar - StatusBar + 'px;', fontSize: fontSizeSetting + 'px;' }"
+                >
+                    消息
+                    <image
+                        class="iconfont icon-qingli"
+                        @click="clearNews"
+                        src="@/static/tabBar/clean_notice.png"
+                    ></image>
+                </view>
+            </view>
+            <view class="container-notice">
+                <view class="notice-cell" @click="navigateTo('/pages/notice/club/notice-order?messageType=1')">
+                    <view class="notice-cell-icon">
+                        <image class="icon-image" src="@/static/tabBar/play_notice.png" mode=""></image>
+                    </view>
+                    <view class="notice-cell-text">
+                        交易物流
+                        <text class="cell-text">官方</text>
+                    </view>
+                    <view class="notice-cell-badge" v-if="tradeCount > 0">
+                        <text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num">
+                            {{ tradeCount | BadgeType }}
+                        </text>
+                    </view>
+                </view>
+                <view class="notice-cell" @click="navigateTo('/pages/notice/club/notice-users?messageType=2')">
+                    <view class="notice-cell-icon">
+                        <image class="icon-image" src="@/static/tabBar/user_notice.png" mode=""></image>
+                    </view>
+                    <view class="notice-cell-text">
+                        账户通知
+                        <text class="cell-text">官方</text>
+                    </view>
+                    <view class="notice-cell-badge" v-if="accountCount > 0">
+                        <text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num">
+                            {{ accountCount | BadgeType }}
+                        </text>
+                    </view>
+                </view>
+                <view class="notice-cell" @click="navigateTo('/pages/notice/club/notice-server?messageType=3')">
+                    <view class="notice-cell-icon">
+                        <image class="icon-image" src="@/static/tabBar/server_notice.png" mode=""></image>
+                    </view>
+                    <view class="notice-cell-text">
+                        服务通知
+                        <text class="cell-text">官方</text>
+                    </view>
+                    <view class="notice-cell-badge" v-if="notificationCount > 0">
+                        <text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num">
+                            {{ notificationCount | BadgeType }}
+                        </text>
+                    </view>
+                </view>
+                <view class="notice-cell" @click="navigateTo('/pages/notice/club/notice-coupon?messageType=4')">
+                    <view class="notice-cell-icon">
+                        <image class="icon-image" src="@/static/tabBar/preferential_notice.png" mode=""></image>
+                    </view>
+                    <view class="notice-cell-text">
+                        优惠促销
+                        <text class="cell-text">官方</text>
+                    </view>
+                    <view class="notice-cell-badge" v-if="promotionCount > 0">
+                        <text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num">
+                            {{ promotionCount | BadgeType }}
+                        </text>
+                    </view>
+                </view>
+                <!-- <view class="notice-cell" @click="navigateTo('/pages/notice/club/notice-article?messageType=5')">
+                	<view class="notice-cell-icon">
+                		<image class="icon-image" :src="'https://static.caimei365.com/app/img/' + 'icon/icon-notice-text@2x.png'" mode=""></image>
+                	</view>
+                	<view class="notice-cell-text"> 最新文章 <text class="cell-text">官方</text> </view>
+                	<view class="notice-cell-badge" v-if="articleCount > 0">
+                		<text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num">
+                			{{ articleCount | BadgeType }}
+                		</text>
+                	</view>
+                </view>
+                <view class="notice-cell" @click="navigateTo('/pages/notice/club/notice-activity?messageType=6')">
+                	<view class="notice-cell-icon">
+                		<image class="icon-image" :src="'https://static.caimei365.com/app/img/' + 'icon/icon-notice-active@2x.png'" mode=""></image>
+                	</view>
+                	<view class="notice-cell-text"> 最新活动 <text class="cell-text">官方</text> </view>
+                	<view class="notice-cell-badge" v-if="activityCount > 0">
+                		<text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num">
+                			{{ activityCount | BadgeType }}
+                		</text>
+                	</view>
+                </view> -->
+            </view>
+        </view>
+    </view>
+</template>
+
+<script>
+import { fetchMessageCount, updateHeheMessageAsRead } from '@/services/api/notice.js'
+import { getStorage } from '@/common/storage.js'
+import { mapActions } from 'vuex'
+
+export default {
+    data() {
+        return {
+            skeletonShow: true,
+            CustomBar: '',
+            StatusBar: '',
+            fontSizeSetting: '',
+            StaticUrl: '',
+            clubId: 0,
+            allCount: 0,
+            tradeCount: 0,
+            accountCount: 0,
+            notificationCount: 0,
+            promotionCount: 0,
+            articleCount: 0,
+            activityCount: 0,
+            userId: 0
+        }
+    },
+    filters: {
+        BadgeType: val => (val && val >= 99 ? '99+' : val) // 红点的提示信息
+    },
+    watch: {},
+    onPullDownRefresh() {
+        uni.stopPullDownRefresh()
+    },
+    onShow() {
+        this.userId = getStorage('USER_INFO').userId || 0
+        if (this.userId) {
+            this.initData()
+        } else {
+            this.initLogin()
+        }
+    },
+    methods: {
+        ...mapActions('user', ['updateNoticeNum']),
+        initLogin() {
+            uni.redirectTo({ url: '/pages/authorize/login-custom' })
+        },
+        async initData() {
+            this.getSystomInfo()
+            const { data } = await fetchMessageCount({ commonId: this.userId })
+            this.tradeCount = data.tradeCount // 交易物流
+            this.accountCount = data.account // 账户通知
+            this.notificationCount = data.notificationCount // 服务通知
+            this.promotionCount = data.promotionCount // 优惠促销
+            this.activityCount = data.activityCount // 活动通知
+            this.articleCount = data.infoCount // 文章通知
+            this.allCount = data.count // 总数
+            this.skeletonShow = false //预加载圆圈隐藏
+        },
+        getSystomInfo() {
+            uni.getSystemInfo({
+                success: e => {
+                    if (e.platform == 'android') {
+                        this.CustomBar = e.statusBarHeight + 50
+                    } else {
+                        this.CustomBar = e.statusBarHeight + 45
+                    }
+                    this.StatusBar = e.statusBarHeight
+                    this.fontSizeSetting = e.fontSizeSetting
+                }
+            })
+        },
+        async clearNews() {
+            try {
+                if (this.allCount > 0) {
+                    await updateHeheMessageAsRead({ commonId: this.userId })
+                    this.initData()
+                    this.updateNoticeNum()
+                    uni.showToast({
+                        title: '清理成功',
+                        icon: 'success'
+                    })
+                } else {
+                    uni.showToast({
+                        title: '暂无新的消息'
+                    })
+                }
+            } catch (e) {
+                console.log(e)
+            }
+        },
+        navigateTo(url) {
+            uni.navigateTo({
+                url: url
+            })
+        }
+    }
+}
+</script>
+
+<style lang="scss">
+.navbar-wrap {
+    position: fixed;
+    width: 100%;
+    top: 0;
+    z-index: 100000;
+    box-sizing: border-box;
+    background: #ffffff;
+    .navbar-text {
+        font-size: 30rpx;
+        color: #000000;
+        font-weight: 500;
+        text-align: center;
+        .iconfont {
+            display: inline-block;
+            width: 48rpx;
+            height: 48rpx;
+            border-radius: 50%;
+            background-color: #f5f5f5;
+            text-align: center;
+            line-height: 48rpx;
+            color: #666666;
+            font-size: 30rpx;
+            margin-left: 20rpx;
+        }
+    }
+}
+.container-notice {
+    width: 100%;
+    height: auto;
+    box-sizing: border-box;
+    padding: 0 24rpx;
+    padding-top: 20rpx;
+    .notice-cell {
+        width: 100%;
+        height: 130rpx;
+        box-sizing: border-box;
+        padding: 19rpx 0;
+        border-bottom: 1px solid #e1e1e1;
+        .notice-cell-icon {
+            width: 92rpx;
+            height: 92rpx;
+            float: left;
+            .icon-image {
+                width: 92rpx;
+                height: 92rpx;
+                display: block;
+            }
+        }
+        .notice-cell-text {
+            width: 400rpx;
+            height: 100%;
+            line-height: 92rpx;
+            font-size: 34rpx;
+            text-align: left;
+            margin-left: 24rpx;
+            float: left;
+            .cell-text {
+                display: inline-block;
+                height: 32rpx;
+                padding: 0 11rpx;
+                line-height: 32rpx;
+                border-radius: 20rpx;
+                text-align: center;
+                border: 1px solid #e15616;
+                font-size: 24rpx;
+                color: #e15616;
+                margin-left: 10rpx;
+            }
+        }
+        .notice-cell-badge {
+            width: 92rpx;
+            height: 92rpx;
+            float: right;
+            box-sizing: border-box;
+            padding: 25rpx 15rpx;
+            text-align: right;
+        }
+    }
+}
+.uni-badge--small {
+    -webkit-transform: scale(0.8);
+    -ms-transform: scale(0.8);
+    transform: scale(0.8);
+    -webkit-transform-origin: center center;
+    -ms-transform-origin: center center;
+    transform-origin: center center;
+}
+.uni-badge {
+    font-family: 'Helvetica Neue', Helvetica, sans-serif;
+    -webkit-box-sizing: border-box;
+    box-sizing: border-box;
+    font-size: 12px;
+    line-height: 1;
+    display: inline-block;
+    padding: 3px 6px;
+    color: #333;
+    border-radius: 100px;
+    background-color: #f1f1f1;
+}
+.uni-badge-error {
+    color: #fff;
+    background-color: #ff2a2a;
+}
 </style>
 </style>

+ 80 - 0
services/api/notice.js

@@ -0,0 +1,80 @@
+import request from '@/services/http.request.js'
+const env = process.env.NODE_ENV === 'development' ? 'https://core-b.caimei365.com' : 'https://core.caimei365.com'
+/* 获取消息列表 */
+/**
+ * messageType
+    commonId
+    pageNum
+    pageNum
+ * @param {Object} params
+ */
+export function fetchMessageList(params) {
+    return request({
+        url: env + '/user/login/auth/heheMessageList',
+        method: 'GET',
+        params
+    })
+}
+
+/**
+ * messageType
+ * commonId
+ * 获取未读消息
+ * @param {Object} params
+ */
+export function fetchMessageCount(params) {
+    return request({
+        url: env + '/user/login/auth/heheMessageCount',
+        method: 'GET',
+        params
+    })
+}
+
+/**
+ * messageType
+ * commonId
+ * 获取单独一个消息模块的未读消息
+ * @param {Object} params
+ */
+export function fetchOneMessageCount(params) {
+    return request({
+        url: env + '/user/login/auth/heheOneMessageCount',
+        method: 'GET',
+        params
+    })
+}
+
+/**
+ *@删除通知消息
+ *@param id:消息Id
+ */
+export function authDeleteMessage(data) {
+    return request({
+        url: env + '/user/login/auth/deleteMessage',
+        method: 'POST',
+        data
+    })
+}
+
+/**
+ *@机构标记通知消息已读
+ *@param userType: 4
+ *@param Id: userId
+ */
+export function authUpdateMessageAsRead(data) {
+    return request({
+        url: env + '/user/login/auth/updateRead',
+        data,
+        method: 'POST'
+    })
+}
+/**
+ * @信息标记为已读
+ */
+export function updateHeheMessageAsRead(data) {
+    return request({
+        url: env + '/user/login/auth/updateHeheMessageAsRead',
+        data,
+        method: 'GET'
+    })
+}

+ 60 - 57
services/http.interceptor.js

@@ -1,57 +1,60 @@
-import http from '@/services/http.instence.js'
-
-// 土司提示
-const toast = (message) => {
-    uni.showToast({
-        icon: 'none',
-        mask: true,
-        title: message
-    })
-}
-
-http.interceptors.request.use((config) => {
-    uni.showLoading({
-        mask: true,
-        title: config.custom.loading
-    })
-    // 可使用async await 做异步操作
-    config.header = {
-        ...config.header,
-    }
-    /**
-    // 如果token不存在,return Promise.reject(config) 会取消本次请求
-    if (!token) { 
-       return Promise.reject(config)
-    }
-     **/
-    return config
-}, config => { // 可使用async await 做异步操作
-    return Promise.reject(config)
-})
-
-http.interceptors.response.use((response) => {
-    /* 对响应成功做点什么 可使用async await 做异步操作*/
-    const code = response.data.code
-    // 服务端返回的状态码不等于-1,则reject()
-    if (code === -1) {
-        toast(response.data.msg || '系统错误')
-        return Promise.reject(response.data)
-    }
-    
-    // 用户未注册
-    if (code === -2) {
-        console.log('用户未注册')
-    }
-
-    console.log(response.data)
-    uni.hideLoading()
-    return Promise.resolve(response.data)
-}, (response) => {
-    /*  对响应错误做点什么 (statusCode !== 200)*/
-    console.log(response)
-    uni.hideLoading()
-    return Promise.reject(response)
-})
-
-
-export default http
+import http from '@/services/http.instence.js'
+
+// 土司提示
+const toast = (message) => {
+    uni.showToast({
+        icon: 'none',
+        mask: true,
+        title: message
+    })
+}
+
+http.interceptors.request.use((config) => {
+    uni.showLoading({
+        mask: true,
+        title: config.custom.loading
+    })
+    // 可使用async await 做异步操作
+    config.header = {
+        ...config.header,
+    }
+    if (config.data?.isConfig) {
+        config.header['Content-Type'] = 'application/x-www-form-urlencoded'
+    }
+    /**
+    // 如果token不存在,return Promise.reject(config) 会取消本次请求
+    if (!token) { 
+       return Promise.reject(config)
+    }
+     **/
+    return config
+}, config => { // 可使用async await 做异步操作
+    return Promise.reject(config)
+})
+
+http.interceptors.response.use((response) => {
+    /* 对响应成功做点什么 可使用async await 做异步操作*/
+    const code = response.data.code
+    // 服务端返回的状态码不等于-1,则reject()
+    if (code === -1) {
+        toast(response.data.msg || '系统错误')
+        return Promise.reject(response.data)
+    }
+    
+    // 用户未注册
+    if (code === -2) {
+        console.log('用户未注册')
+    }
+
+    console.log(response.data)
+    uni.hideLoading()
+    return Promise.resolve(response.data)
+}, (response) => {
+    /*  对响应错误做点什么 (statusCode !== 200)*/
+    console.log(response)
+    uni.hideLoading()
+    return Promise.reject(response)
+})
+
+
+export default http

+ 103 - 104
store/modules/cart.js

@@ -1,104 +1,103 @@
-import {
-    removeProductFromCart,
-    fetchCartProductCount,
-    shoppingAddCart,
-    updateProductCount,
-    updateProductUnit
-} from '@/services/api/cart.js'
-
-const state = {
-    kindCount: 0
-}
-
-const mutations = {
-    SET_KIND_COUNT: (state, count) => {
-        state.kindCount = count
-    },
-    // 设置购物车商品数量角标
-    SET_TABBAR_BADGE: (state, num) => {
-        console.log(num)
-        if (num >= 100) {
-            return uni.setTabBarBadge({ index: 2, text: '99+' })
-        }
-        if (num > 0) {
-            return uni.setTabBarBadge({ index: 2, text: num.toString() })
-        }
-        uni.removeTabBarBadge({ index: 2 })
-    },
-}
-
-const actions = {
-    // 加入购物车
-    async addToCart({ dispatch, rootGetters }, { skuId, productCount = 1, heUserId = 0 }) {
-
-        if (!rootGetters.userId) {
-            const pages = getCurrentPages()
-            const page = pages[pages.length - 1]
-            uni.setStorageSync('LOGIN_REDIRECT_URL', page.$page.fullPath)
-            uni.redirectTo({ url: '/pages/authorize/login-custom' })
-            return Promise.reject('用户未登录')
-        }
-
-        try {
-            const res = await shoppingAddCart({ skuId, userId: rootGetters.userId, productCount, heUserId })
-            dispatch('fetchCartKindCount')
-            setTimeout(() => {
-                uni.showToast({
-                    icon: 'success',
-                    title: '加入购物车成功',
-                    mask: true
-                })
-            }, 200)
-
-            return res
-        } catch (e) {
-            return Promise.reject(e)
-        }
-    },
-    // 获取购物车商品数量
-    async fetchCartKindCount({ commit, rootGetters }) {
-        try {
-            const res = await fetchCartProductCount({ userId: rootGetters.userId })
-            commit('SET_KIND_COUNT', res.data)
-            commit('SET_TABBAR_BADGE', res.data)
-            return res
-        } catch (e) {
-            return Promise.reject(e)
-        }
-    },
-    // 从购物车移除
-    async removeFromCart({ commit, dispatch }, cartIds = []) {
-        try {
-            const res = await removeProductFromCart({ cartIds: cartIds.join(',') })
-            await dispatch('fetchCartKindCount')
-            uni.showToast({ icon: 'success', title: '删除成功' })
-            return res
-        } catch (e) {
-            return Promise.reject(e)
-        }
-    },
-    // 加减购物车商品更新到后台
-    async updateProductCount({ dispatch }, { cartId, productCount }) {
-        try {
-            return updateProductCount({ cartId, productCount })
-        } catch (e) {
-            return Promise.reject(e)
-        }
-    },
-
-    // 购物车商品规格更新
-    async updateProductUnit({ dispatch }, { cartId, newSkuId, productCount }) {
-        try {
-            return updateProductUnit({ newSkuId, cartId, count: productCount })
-        } catch (e) {
-            return Promise.reject(e)
-        }
-    }
-}
-
-export default {
-    namespaced: true,
-    state,
-    mutations,
-    actions
-}
+import {
+    removeProductFromCart,
+    fetchCartProductCount,
+    shoppingAddCart,
+    updateProductCount,
+    updateProductUnit
+} from '@/services/api/cart.js'
+
+const state = {
+    kindCount: 0
+}
+
+const mutations = {
+    SET_KIND_COUNT: (state, count) => {
+        state.kindCount = count
+    },
+    // 设置购物车商品数量角标
+    SET_TABBAR_BADGE: (state, num) => {
+        if (num >= 100) {
+            return uni.setTabBarBadge({ index: 3, text: '99+' })
+        }
+        if (num > 0) {
+            return uni.setTabBarBadge({ index: 3, text: num.toString() })
+        }
+        uni.removeTabBarBadge({ index: 3 })
+    },
+}
+
+const actions = {
+    // 加入购物车
+    async addToCart({ dispatch, rootGetters }, { skuId, productCount = 1, heUserId = 0 }) {
+
+        if (!rootGetters.userId) {
+            const pages = getCurrentPages()
+            const page = pages[pages.length - 1]
+            uni.setStorageSync('LOGIN_REDIRECT_URL', page.$page.fullPath)
+            uni.redirectTo({ url: '/pages/authorize/login-custom' })
+            return Promise.reject('用户未登录')
+        }
+
+        try {
+            const res = await shoppingAddCart({ skuId, userId: rootGetters.userId, productCount, heUserId })
+            dispatch('fetchCartKindCount')
+            setTimeout(() => {
+                uni.showToast({
+                    icon: 'success',
+                    title: '加入购物车成功',
+                    mask: true
+                })
+            }, 200)
+
+            return res
+        } catch (e) {
+            return Promise.reject(e)
+        }
+    },
+    // 获取购物车商品数量
+    async fetchCartKindCount({ commit, rootGetters }) {
+        try {
+            const res = await fetchCartProductCount({ userId: rootGetters.userId })
+            commit('SET_KIND_COUNT', res.data)
+            commit('SET_TABBAR_BADGE', res.data)
+            return res
+        } catch (e) {
+            return Promise.reject(e)
+        }
+    },
+    // 从购物车移除
+    async removeFromCart({ commit, dispatch }, cartIds = []) {
+        try {
+            const res = await removeProductFromCart({ cartIds: cartIds.join(',') })
+            await dispatch('fetchCartKindCount')
+            uni.showToast({ icon: 'success', title: '删除成功' })
+            return res
+        } catch (e) {
+            return Promise.reject(e)
+        }
+    },
+    // 加减购物车商品更新到后台
+    async updateProductCount({ dispatch }, { cartId, productCount }) {
+        try {
+            return updateProductCount({ cartId, productCount })
+        } catch (e) {
+            return Promise.reject(e)
+        }
+    },
+
+    // 购物车商品规格更新
+    async updateProductUnit({ dispatch }, { cartId, newSkuId, productCount }) {
+        try {
+            return updateProductUnit({ newSkuId, cartId, count: productCount })
+        } catch (e) {
+            return Promise.reject(e)
+        }
+    }
+}
+
+export default {
+    namespaced: true,
+    state,
+    mutations,
+    actions
+}

+ 29 - 4
store/modules/user.js

@@ -1,4 +1,5 @@
-import { wechatAuthLogin, mobileLogin, getAccessToken } from '@/services/api/auth.js'
+import { wechatAuthLogin, mobileLogin, getAccessToken } from '@/services/api/auth.js'
+import { fetchMessageCount } from '@/services/api/notice.js'
 import { wxLogin } from '@/common/auth.js'
 import { wxLogin } from '@/common/auth.js'
 import { setStorage, getStorage } from '@/common/storage.js'
 import { setStorage, getStorage } from '@/common/storage.js'
 import { objAssign } from '@/common/utils.js'
 import { objAssign } from '@/common/utils.js'
@@ -14,7 +15,8 @@ function initUserState() {
         userIdentity: -1, // 用户类型
         userIdentity: -1, // 用户类型
         inviteUserId: '', // 分享者用户ID
         inviteUserId: '', // 分享者用户ID
         accessToken: '', // token
         accessToken: '', // token
-        hasLogin: false, // 用户是否登录
+        hasLogin: false, // 用户是否登录
+        notice_count: 0, // 消息通知数量
     }
     }
     const userInfo = getStorage('USER_INFO')
     const userInfo = getStorage('USER_INFO')
     if (userInfo) {
     if (userInfo) {
@@ -44,7 +46,19 @@ const mutations = {
     },
     },
     SET_LOGINOUT: (state, logout) => {
     SET_LOGINOUT: (state, logout) => {
         state.hasLogin = logout
         state.hasLogin = logout
-    },
+    },
+    SET_NOTICE_COUNT: (state, count) => {
+        state.notice_count = count
+    },
+    SET_TABBAR_BADGE: (state, count) => {
+        if (count >= 100) {
+            return uni.setTabBarBadge({ index: 2, text: '99+' })
+        }
+        if (count > 0) {
+            return uni.setTabBarBadge({ index: 2, text: count.toString() })
+        }
+        uni.removeTabBarBadge({ index: 2 })
+    }
 }
 }
 
 
 const actions = {
 const actions = {
@@ -88,7 +102,18 @@ const actions = {
             commit('SET_LOGINOUT', false)
             commit('SET_LOGINOUT', false)
             console.log(e)
             console.log(e)
         }
         }
-    }
+    },
+    // 短信消息统计
+    async updateNoticeNum({ commit }) { // 更新通知消息数量
+        try{
+            const commonId = getStorage('USER_INFO').userId || 0
+            const { data } = await fetchMessageCount({ commonId })
+            commit('SET_NOTICE_COUNT', data.count)
+            commit('SET_TABBAR_BADGE', data.count)
+        }catch(error){
+            console.log(error)
+        }
+    },
 }
 }
 
 
 export default {
 export default {