diff --git a/pages/index/user.vue b/pages/index/user.vue index 37e6291b..b49bb91e 100644 --- a/pages/index/user.vue +++ b/pages/index/user.vue @@ -1,41 +1,41 @@ - + \ No newline at end of file diff --git a/sheep/api/cart.js b/sheep/api/cart.js index 1b1e22ad..11b457b4 100644 --- a/sheep/api/cart.js +++ b/sheep/api/cart.js @@ -1,10 +1,9 @@ import request from '@/sheep/request'; -import request2 from '@/sheep/request2'; export default { list: (data) => - request2({ - url: 'trade/cart/list', + request({ + url: '/app-api/trade/cart/list', method: 'GET', custom: { showLoading: false, @@ -12,7 +11,7 @@ export default { }, }), append: (data) => - request2({ + request({ url: '/app-api/trade/cart/add', method: 'POST', custom: { @@ -39,13 +38,13 @@ export default { // }), // 删除购物车 delete: (ids) => - request2({ - url: 'trade/cart/delete?ids=' + ids, + request({ + url: '/app-api/trade/cart/delete?ids=' + ids, method: 'DELETE', }), update: (data) => - request2({ - url: 'trade/cart/update-count', + request({ + url: '/app-api/trade/cart/update-count', method: 'PUT', data: { ...data, diff --git a/sheep/api/category.js b/sheep/api/category.js index 9c825069..f74c3327 100644 --- a/sheep/api/category.js +++ b/sheep/api/category.js @@ -1,10 +1,8 @@ -import request2 from '@/sheep/request2'; - export default { - list: (params) => - request2({ - url: 'product/category/list', - method: 'GET', - params, - }), -}; + list: (params) => + request({ + url: '/app-api/product/category/list', + method: 'GET', + params, + }), +}; \ No newline at end of file diff --git a/sheep/api/coupon.js b/sheep/api/coupon.js index 446af00b..a683df3a 100644 --- a/sheep/api/coupon.js +++ b/sheep/api/coupon.js @@ -1,5 +1,4 @@ import request from '@/sheep/request'; -import request2 from '@/sheep/request2'; export default { // 我的拼团 @@ -13,8 +12,8 @@ export default { }, }), userCoupon: (params) => - request2({ - url: 'promotion/coupon/page', + request({ + url: '/app-api/promotion/coupon/page', method: 'GET', params, }), @@ -33,8 +32,8 @@ export default { }, }), get: (id) => - request2({ - url: 'promotion/coupon/take', + request({ + url: '/app-api/promotion/coupon/take', method: 'POST', data: { templateId: id diff --git a/sheep/api/data.js b/sheep/api/data.js index 6a5b08b1..d1e38bb0 100644 --- a/sheep/api/data.js +++ b/sheep/api/data.js @@ -1,25 +1,24 @@ import request from '@/sheep/request'; -import request2 from '@/sheep/request2'; export default { - area: () => - request2({ - url: 'system/area/tree', - method: 'GET', - }), - // area: () => - // request({ - // url: 'data/area', - // method: 'GET', - // }), - faq: () => - request({ - url: 'data/faq', - method: 'GET', - }), - richtext: (id) => - request({ - url: 'data/richtext/' + id, - method: 'GET', - }), -}; + area: () => + request({ + url: '/app-api/system/area/tree', + method: 'GET', + }), + // area: () => + // request({ + // url: 'data/area', + // method: 'GET', + // }), + faq: () => + request({ + url: 'data/faq', + method: 'GET', + }), + richtext: (id) => + request({ + url: 'data/richtext/' + id, + method: 'GET', + }), +}; \ No newline at end of file diff --git a/sheep/api/goods.js b/sheep/api/goods.js index 06878f35..a6206e8c 100644 --- a/sheep/api/goods.js +++ b/sheep/api/goods.js @@ -1,5 +1,4 @@ import request from '@/sheep/request'; -import request2 from '@/sheep/request2'; export default { // 商品详情 diff --git a/sheep/api/index2.js b/sheep/api/index2.js index 1c068bf8..7f6a12ef 100644 --- a/sheep/api/index2.js +++ b/sheep/api/index2.js @@ -1,14 +1,14 @@ -import request2 from '@/sheep/request2'; +import request from '@/sheep/request'; export default { - decorate: () => - request2({ - url: 'promotion/decorate/list?page=1', - method: 'GET', - }), - spids: () => - request2({ - url: 'product/spu/page?recommendType=best&pageNo=1&pageSize=10', - method: 'GET', - }), -}; + decorate: () => + request({ + url: '/app-api/promotion/decorate/list?page=1', + method: 'GET', + }), + spids: () => + request({ + url: '/app-api/product/spu/page?recommendType=best&pageNo=1&pageSize=10', + method: 'GET', + }), +}; \ No newline at end of file diff --git a/sheep/api/order.js b/sheep/api/order.js index e7bb5e6a..227849d6 100644 --- a/sheep/api/order.js +++ b/sheep/api/order.js @@ -1,11 +1,10 @@ import request from '@/sheep/request'; -import request2 from '@/sheep/request2'; export default { // 订单详情 detail: (id, params) => - request2({ - url: 'trade/order/get-detail?id=' + id, + request({ + url: '/app-api/trade/order/get-detail?id=' + id, method: 'GET', params, }), @@ -40,8 +39,8 @@ export default { }), // 订单列表 list: (params) => - request2({ - url: 'trade/order/page', + request({ + url: '/app-api/trade/order/page', method: 'GET', params, custom: { @@ -66,9 +65,9 @@ export default { delete data2.items for (let i = 0; i < data.items.length; i++) { // 此处转码问题,待解决方案 - // data2[encodeURIComponent('items[' + i + '' + '].skuId')] = data.items[i].skuId + ''; - // data2[encodeURIComponent('items[' + i + '' + '].count')] = data.items[i].count + ''; - // data2[encodeURIComponent('items[' + i + '' + '].cartId')] = data.items[i].cartId + ''; + data2[encodeURIComponent('items[' + i + '' + '].skuId')] = data.items[i].skuId + ''; + data2[encodeURIComponent('items[' + i + '' + '].count')] = data.items[i].count + ''; + data2[encodeURIComponent('items[' + i + '' + '].cartId')] = data.items[i].cartId + ''; // data2['items' + `[${i}]` + '.skuId'] = data.items[i].skuId + ''; // data2['items' + `[${i}]` + '.count'] = data.items[i].count + ''; @@ -79,8 +78,8 @@ export default { // data2['items' + `%5B${i}%5D` + '.cartId'] = data.items[i].cartId + ''; } console.log(data2, '手动转码的参数') - return request2({ - url: 'trade/order/settlement', + return request({ + url: '/app-api/trade/order/settlement', method: 'GET', // data: data2, params: data2 @@ -114,8 +113,8 @@ export default { }), // 评价订单 comment: (data) => - request2({ - url: 'trade/order/item/create-comment', + request({ + url: '/app-api/trade/order/item/create-comment', method: 'POST', data, }), @@ -153,8 +152,8 @@ export default { data, }), list: (params) => - request2({ - url: 'trade/after-sale/page', + request({ + url: '/app-api/trade/after-sale/page', method: 'GET', params, custom: { @@ -184,8 +183,8 @@ export default { }), // 售后详情 detail: (id) => - request2({ - url: 'trade/after-sale/get?id=' + id, + request({ + url: '/app-api/trade/after-sale/get?id=' + id, method: 'GET', }), }, diff --git a/sheep/api/promotion/activity.js b/sheep/api/promotion/activity.js index efa0e1e9..6ad6ad35 100644 --- a/sheep/api/promotion/activity.js +++ b/sheep/api/promotion/activity.js @@ -1,16 +1,16 @@ -import request2 from '@/sheep/request2'; +import request from '@/sheep/request'; const ActivityApi = { - // 获得单个商品,近期参与的每个活动 - getActivityListBySpuId: (spuId) => { - return request2({ - url: '/app-api/promotion/activity/list-by-spu-id', - method: 'GET', - params: { - spuId, - }, - }); - }, + // 获得单个商品,近期参与的每个活动 + getActivityListBySpuId: (spuId) => { + return request({ + url: '/app-api/promotion/activity/list-by-spu-id', + method: 'GET', + params: { + spuId, + }, + }); + }, }; -export default ActivityApi; +export default ActivityApi; \ No newline at end of file diff --git a/sheep/api/promotion/combination.js b/sheep/api/promotion/combination.js index eeeb9a0a..5d09373e 100644 --- a/sheep/api/promotion/combination.js +++ b/sheep/api/promotion/combination.js @@ -1,67 +1,69 @@ -import request2 from "@/sheep/request2"; +import request from "@/sheep/request"; // 拼团 API const CombinationApi = { - // 获得拼团活动列表 - getCombinationActivityList: (count) => { - return request2({ - url: "promotion/combination-activity/list", - method: 'GET', - params: {count} - }); - }, + // 获得拼团活动列表 + getCombinationActivityList: (count) => { + return request({ + url: "/app-api/promotion/combination-activity/list", + method: 'GET', + params: { + count + } + }); + }, - // 获得拼团活动分页 - getCombinationActivityPage: (params) => { - return request2({ - url: "promotion/combination-activity/page", - method: 'GET', - params - }); - }, + // 获得拼团活动分页 + getCombinationActivityPage: (params) => { + return request({ + url: "/app-api/promotion/combination-activity/page", + method: 'GET', + params + }); + }, - // 获得拼团活动明细 - getCombinationActivity: (id) => { - return request2({ - url: "promotion/combination-activity/get-detail", - method: 'GET', - params: { - id - } - }); - }, + // 获得拼团活动明细 + getCombinationActivity: (id) => { + return request({ + url: "/app-api/promotion/combination-activity/get-detail", + method: 'GET', + params: { + id + } + }); + }, - // 获得最近 n 条拼团记录(团长发起的) - getHeadCombinationRecordList: (activityId, status, count) => { - return request2({ - url: "promotion/combination-record/get-head-list", - method: 'GET', - params: { - activityId, - status, - count - } - }); - }, + // 获得最近 n 条拼团记录(团长发起的) + getHeadCombinationRecordList: (activityId, status, count) => { + return request({ + url: "/app-api/promotion/combination-record/get-head-list", + method: 'GET', + params: { + activityId, + status, + count + } + }); + }, - // 获得拼团记录明细 - getCombinationRecordDetail: (id) => { - return request2({ - url: "promotion/combination-record/get-detail", - method: 'GET', - params: { - id - } - }); - }, + // 获得拼团记录明细 + getCombinationRecordDetail: (id) => { + return request({ + url: "/app-api/promotion/combination-record/get-detail", + method: 'GET', + params: { + id + } + }); + }, - // 获得拼团记录的概要信息 - getCombinationRecordSummary: () => { - return request2({ - url: "promotion/combination-record/get-summary", - method: 'GET', - }); - } + // 获得拼团记录的概要信息 + getCombinationRecordSummary: () => { + return request({ + url: "/app-api/promotion/combination-record/get-summary", + method: 'GET', + }); + } } -export default CombinationApi +export default CombinationApi \ No newline at end of file diff --git a/sheep/api/promotion/coupon.js b/sheep/api/promotion/coupon.js index b1de2caf..57287331 100644 --- a/sheep/api/promotion/coupon.js +++ b/sheep/api/promotion/coupon.js @@ -1,5 +1,4 @@ import request from '@/sheep/request'; -import request2 from '@/sheep/request2'; export default { // 获得优惠劵模板列表 @@ -14,8 +13,8 @@ export default { }, // 获得优惠劵模版列表 getCouponTemplateList: (params) => { - return request2({ - url: `promotion/coupon/match-list?price=${params.price}&spuIds=${params.spuIds}&skuIds=${params.skuIds}&categoryIds=${params.categoryIds}`, + return request({ + url: `/app-api/promotion/coupon/match-list?price=${params.price}&spuIds=${params.spuIds}&skuIds=${params.skuIds}&categoryIds=${params.categoryIds}`, method: 'GET', // params, }); diff --git a/sheep/api/promotion/seckill.js b/sheep/api/promotion/seckill.js index ecbb4c1f..d16a0f79 100644 --- a/sheep/api/promotion/seckill.js +++ b/sheep/api/promotion/seckill.js @@ -1,33 +1,44 @@ -import request2 from "@/sheep/request2"; +import request from "@/sheep/request"; const SeckillApi = { - // 获得秒杀时间段列表 - getSeckillConfigList: () => { - return request2({ url: 'promotion/seckill-config/list', method: 'GET' }); - }, + // 获得秒杀时间段列表 + getSeckillConfigList: () => { + return request({ + url: '/app-api/promotion/seckill-config/list', + method: 'GET' + }); + }, - // 获得当前秒杀活动 - getNowSeckillActivity: () => { - return request2({ url: 'promotion/seckill-activity/get-now', method: 'GET' }); - }, + // 获得当前秒杀活动 + getNowSeckillActivity: () => { + return request({ + url: '/app-api/promotion/seckill-activity/get-now', + method: 'GET' + }); + }, - // 获得秒杀活动分页 - getSeckillActivityPage: () => { - return request2({ url: 'promotion/seckill-activity/page', method: 'GET' }); - }, + // 获得秒杀活动分页 + getSeckillActivityPage: () => { + return request({ + url: '/app-api/promotion/seckill-activity/page', + method: 'GET' + }); + }, - /** - * 获得秒杀活动明细 - * @param {number} id 秒杀活动编号 - * @return {*} - */ - getSeckillActivity: (id) => { - return request2({ - url: 'promotion/seckill-activity/get-detail', - method: 'GET', - params: { id } - }); - } + /** + * 获得秒杀活动明细 + * @param {number} id 秒杀活动编号 + * @return {*} + */ + getSeckillActivity: (id) => { + return request({ + url: '/app-api/promotion/seckill-activity/get-detail', + method: 'GET', + params: { + id + } + }); + } } -export default SeckillApi; +export default SeckillApi; \ No newline at end of file diff --git a/uni_modules/mp-html/components/mp-html/parser.js b/uni_modules/mp-html/components/mp-html/parser.js index 2cf0694d..c74b1a64 100644 --- a/uni_modules/mp-html/components/mp-html/parser.js +++ b/uni_modules/mp-html/components/mp-html/parser.js @@ -7,7 +7,7 @@ const config = { // 信任的标签(保持标签名不变) trustTags: makeMap( 'a,abbr,ad,audio,b,blockquote,br,code,col,colgroup,dd,del,dl,dt,div,em,fieldset,h1,h2,h3,h4,h5,h6,hr,i,img,ins,label,legend,li,ol,p,q,ruby,rt,source,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,title,ul,video' - ), + ), // 块级标签(转为 div,其他的非信任标签转为 span) blockTags: makeMap('address,article,aside,body,caption,center,cite,footer,header,html,nav,pre,section'), @@ -20,12 +20,12 @@ const config = { // 要移除的标签 ignoreTags: makeMap( 'area,base,canvas,embed,frame,head,iframe,input,link,map,meta,param,rp,script,source,style,textarea,title,track,wbr' - ), + ), // 自闭合的标签 voidTags: makeMap( 'area,base,br,col,circle,ellipse,embed,frame,hr,img,input,line,link,meta,param,path,polygon,rect,source,track,use,wbr' - ), + ), // html 实体 entities: { @@ -364,7 +364,7 @@ Parser.prototype.onAttrName = function(name) { * @private */ Parser.prototype.onAttrVal = function(val) { - console.log(val, '解码转码') + // console.log(val, '解码转码') const name = this.attrName || '' if (name === 'style' || name === 'href') { // 部分属性进行实体解码 @@ -502,7 +502,7 @@ Parser.prototype.onOpenTag = function(selfClose) { for (let j = i + 1; j < this.stack.length; j++) { const style = this.stack[j].attrs.style || '' if (!style.includes(';width') && !style.includes(' width') && style.indexOf( - 'width') !== 0) { + 'width') !== 0) { styleObj.width = '' break } @@ -1151,7 +1151,7 @@ Parser.prototype.onText = function(text) { if (this.hook(node)) { // #ifdef MP-WEIXIN if (this.options.selectable === 'force' && system.includes('iOS') && !uni.canIUse( - 'rich-text.user-select')) { + 'rich-text.user-select')) { this.expose() } // #endif