[
  {
    "path": ".gitignore",
    "content": "project.config.json\n"
  },
  {
    "path": "README.md",
    "content": "### NideShop商城（微信小程序端）\n\n+ 界面高仿网易严选商城(主要是2016年wap版)\n+ 测试数据采集自网易严选商城\n+ 功能和数据库参考ecshop\n+ 服务端api基于Ｎode.js+ThinkJS+MySQL\n+ 计划添加基于Vue.js的后台管理系统、PC版、Ｗap版\n\n**注意：当前版本功能还未完善，请勿商用。**\n\n本项目需要配合NideShop商城服务端使用，GitHub: [https://github.com/tumobi/nideshop](https://github.com/tumobi/nideshop)\n\n[云服务器ECS-云主机优惠-2折上云](https://www.aliyun.com/daily-act/ecs/activity_selection?userCode=3grpysgf)\n\n### 项目截图\n\n![首页](http://upload-images.jianshu.io/upload_images/3985656-c543b937ac6e79bb.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/320)\n\n![专题](http://upload-images.jianshu.io/upload_images/3985656-bd606aac3b5491c2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/320)\n\n![分类](http://upload-images.jianshu.io/upload_images/3985656-fa9565158376d439.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/320)\n\n![商品列表](http://upload-images.jianshu.io/upload_images/3985656-788b7fd2c4a558d0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/320)\n\n![商品详情](http://upload-images.jianshu.io/upload_images/3985656-99a6e0a57778d85f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/320)\n\n![购物车](http://upload-images.jianshu.io/upload_images/3985656-60ff2307d81f6bb2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/320)\n\n![订单中心](http://upload-images.jianshu.io/upload_images/3985656-dff837e6b2ec87b3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/320)\n\n\n\n### 功能列表\n+ 首页\n+ 分类首页、分类商品、新品首发、人气推荐商品页面\n+ 商品详情页面，包含加入购物车、收藏商品、商品评论功能\n+ 搜索功能\n+ 专题功能\n+ 品牌功能\n+ 完整的购物流程，商品的加入、编辑、删除、批量选择，收货地址的选择，下单支付\n+ 会员中心（订单、收藏、足迹、收货地址、意见反馈）\n....\n\n### 项目结构\n```\n├─config                \n├─lib\n│  └─wxParse　　　\n├─pages\n│  ├─auth\n│  │  ├─login\n│  │  ├─register\n│  │  └─reset\n│  ├─brand\n│  ├─brandDetail\n│  ├─cart\n│  ├─catalog\n│  ├─category\n│  ├─comment\n│  ├─goods\n│  ├─hotGoods\n│  ├─index\n│  ├─logs\n│  ├─newGoods\n│  ├─pay\n│  ├─search\n│  ├─shopping\n│  │  ├─address\n│  │  ├─addressAdd\n│  │  └─checkout\n│  ├─topic\n│  ├─topicDetail\n│  └─ucenter\n│      ├─address\n│      ├─addressAdd\n│      ├─collect\n│      ├─coupon\n│      ├─feedback\n│      ├─footprint\n│      ├─index\n│      ├─order\n│      └─orderDetail\n├─static\n│  └─images\n└─utils\n```\n\n### 服务端api\n项目地址：https://github.com/tumobi/nideshop\n\n### 交流\n喜欢别忘了 Star，有问题可通过微信、公众号、QQ 群联系我，谢谢您的关注。\n\n![联系方式](http://nideshop-static.childsay.com/nideshop-qrcode.png)\n"
  },
  {
    "path": "app.js",
    "content": "App({\n  onLaunch: function () {\n    try {\n      this.globalData.userInfo = JSON.parse(wx.getStorageSync('userInfo'));\n      this.globalData.token = wx.getStorageSync('token');\n    } catch (e) {\n      console.log(e);\n    }\n  },\n\n  globalData: {\n    userInfo: {\n      nickname: '点击登录',\n      avatar: 'http://yanxuan.nosdn.127.net/8945ae63d940cc42406c3f67019c5cb6.png'\n    },\n    token: '',\n  }\n})"
  },
  {
    "path": "app.json",
    "content": "{\n  \"pages\": [\n    \"pages/index/index\",\n    \"pages/catalog/catalog\",\n    \"pages/newGoods/newGoods\",\n    \"pages/hotGoods/hotGoods\",\n    \"pages/ucenter/address/address\",\n    \"pages/ucenter/addressAdd/addressAdd\",\n    \"pages/ucenter/footprint/footprint\",\n    \"pages/ucenter/order/order\",\n    \"pages/ucenter/orderDetail/orderDetail\",\n    \"pages/ucenter/express/express\",\n    \"pages/ucenter/feedback/feedback\",\n    \"pages/ucenter/coupon/coupon\",\n    \"pages/ucenter/collect/collect\",\n    \"pages/auth/login/login\",\n    \"pages/auth/register/register\",\n    \"pages/auth/reset/reset\",\n    \"pages/pay/pay\",\n    \"pages/payResult/payResult\",\n    \"pages/ucenter/index/index\",\n    \"pages/topic/topic\",\n    \"pages/comment/comment\",\n    \"pages/commentPost/commentPost\",\n    \"pages/topicComment/topicComment\",\n    \"pages/brand/brand\",\n    \"pages/brandDetail/brandDetail\",\n    \"pages/search/search\",\n    \"pages/category/category\",\n    \"pages/cart/cart\",\n    \"pages/shopping/checkout/checkout\",\n    \"pages/shopping/address/address\",\n    \"pages/shopping/addressAdd/addressAdd\",\n    \"pages/goods/goods\",\n    \"pages/topicDetail/topicDetail\"\n  ],\n  \"window\": {\n    \"backgroundTextStyle\": \"dark\",\n    \"navigationBarBackgroundColor\": \"#fff\",\n    \"navigationBarTitleText\": \"仿网易严选\",\n    \"navigationBarTextStyle\": \"black\",\n    \"enablePullDownRefresh\": true\n  },\n  \"tabBar\": {\n    \"backgroundColor\": \"#fafafa\",\n    \"borderStyle\": \"white\",\n    \"selectedColor\": \"#b4282d\",\n    \"color\": \"#666\",\n    \"list\": [\n      {\n        \"pagePath\": \"pages/index/index\",\n        \"iconPath\": \"static/images/ic_menu_choice_nor.png\",\n        \"selectedIconPath\": \"static/images/ic_menu_choice_pressed.png\",\n        \"text\": \"首页\"\n      },\n      {\n        \"pagePath\": \"pages/topic/topic\",\n        \"iconPath\": \"static/images/ic_menu_topic_nor.png\",\n        \"selectedIconPath\": \"static/images/ic_menu_topic_pressed.png\",\n        \"text\": \"专题\"\n      },\n      {\n        \"pagePath\": \"pages/catalog/catalog\",\n        \"iconPath\": \"static/images/ic_menu_sort_nor.png\",\n        \"selectedIconPath\": \"static/images/ic_menu_sort_pressed.png\",\n        \"text\": \"分类\"\n      },\n      {\n        \"pagePath\": \"pages/cart/cart\",\n        \"iconPath\": \"static/images/ic_menu_shoping_nor.png\",\n        \"selectedIconPath\": \"static/images/ic_menu_shoping_pressed.png\",\n        \"text\": \"购物车\"\n      },\n      {\n        \"pagePath\": \"pages/ucenter/index/index\",\n        \"iconPath\": \"static/images/ic_menu_me_nor.png\",\n        \"selectedIconPath\": \"static/images/ic_menu_me_pressed.png\",\n        \"text\": \"我的\"\n      }\n    ]\n  },\n  \"networkTimeout\": {\n    \"request\": 10000,\n    \"downloadFile\": 10000\n  },\n  \"debug\": true\n}"
  },
  {
    "path": "app.wxss",
    "content": "/**app.wxss**/\n.container {\n  box-sizing: border-box;\n  background-color: #f4f4f4;\n  font-family: PingFangSC-Light,helvetica,'Heiti SC';\n} \n\nview,image,text,navigator{\n  box-sizing: border-box;\n  padding:0;\n  margin:0;\n\n}\n\nview,text{\n  font-family: PingFangSC-Light,helvetica,'Heiti SC';\n  font-size: 29rpx;\n  color: #333;\n}"
  },
  {
    "path": "config/api.js",
    "content": "const ApiRootUrl = 'http://127.0.0.1:8360/api/';\n\nmodule.exports = {\n  IndexUrl: ApiRootUrl + 'index/index', //首页数据接口\n  CatalogList: ApiRootUrl + 'catalog/index',  //分类目录全部分类数据接口\n  CatalogCurrent: ApiRootUrl + 'catalog/current',  //分类目录当前分类数据接口\n\n  AuthLoginByWeixin: ApiRootUrl + 'auth/loginByWeixin', //微信登录\n\n  GoodsCount: ApiRootUrl + 'goods/count',  //统计商品总数\n  GoodsList: ApiRootUrl + 'goods/list',  //获得商品列表\n  GoodsCategory: ApiRootUrl + 'goods/category',  //获得分类数据\n  GoodsDetail: ApiRootUrl + 'goods/detail',  //获得商品的详情\n  GoodsNew: ApiRootUrl + 'goods/new',  //新品\n  GoodsHot: ApiRootUrl + 'goods/hot',  //热门\n  GoodsRelated: ApiRootUrl + 'goods/related',  //商品详情页的关联商品（大家都在看）\n\n  BrandList: ApiRootUrl + 'brand/list',  //品牌列表\n  BrandDetail: ApiRootUrl + 'brand/detail',  //品牌详情\n\n  CartList: ApiRootUrl + 'cart/index', //获取购物车的数据\n  CartAdd: ApiRootUrl + 'cart/add', // 添加商品到购物车\n  CartUpdate: ApiRootUrl + 'cart/update', // 更新购物车的商品\n  CartDelete: ApiRootUrl + 'cart/delete', // 删除购物车的商品\n  CartChecked: ApiRootUrl + 'cart/checked', // 选择或取消选择商品\n  CartGoodsCount: ApiRootUrl + 'cart/goodscount', // 获取购物车商品件数\n  CartCheckout: ApiRootUrl + 'cart/checkout', // 下单前信息确认\n\n  OrderSubmit: ApiRootUrl + 'order/submit', // 提交订单\n  PayPrepayId: ApiRootUrl + 'pay/prepay', //获取微信统一下单prepay_id\n\n  CollectList: ApiRootUrl + 'collect/list',  //收藏列表\n  CollectAddOrDelete: ApiRootUrl + 'collect/addordelete',  //添加或取消收藏\n\n  CommentList: ApiRootUrl + 'comment/list',  //评论列表\n  CommentCount: ApiRootUrl + 'comment/count',  //评论总数\n  CommentPost: ApiRootUrl + 'comment/post',   //发表评论\n\n  TopicList: ApiRootUrl + 'topic/list',  //专题列表\n  TopicDetail: ApiRootUrl + 'topic/detail',  //专题详情\n  TopicRelated: ApiRootUrl + 'topic/related',  //相关专题\n\n  SearchIndex: ApiRootUrl + 'search/index',  //搜索页面数据\n  SearchResult: ApiRootUrl + 'search/result',  //搜索数据\n  SearchHelper: ApiRootUrl + 'search/helper',  //搜索帮助\n  SearchClearHistory: ApiRootUrl + 'search/clearhistory',  //搜索帮助\n\n  AddressList: ApiRootUrl + 'address/list',  //收货地址列表\n  AddressDetail: ApiRootUrl + 'address/detail',  //收货地址详情\n  AddressSave: ApiRootUrl + 'address/save',  //保存收货地址\n  AddressDelete: ApiRootUrl + 'address/delete',  //保存收货地址\n\n  RegionList: ApiRootUrl + 'region/list',  //获取区域列表\n\n  OrderList: ApiRootUrl + 'order/list',  //订单列表\n  OrderDetail: ApiRootUrl + 'order/detail',  //订单详情\n  OrderCancel: ApiRootUrl + 'order/cancel',  //取消订单\n  OrderExpress: ApiRootUrl + 'order/express', //物流详情\n\n  FootprintList: ApiRootUrl + 'footprint/list',  //足迹列表\n  FootprintDelete: ApiRootUrl + 'footprint/delete',  //删除足迹\n};"
  },
  {
    "path": "lib/wxParse/html2json.js",
    "content": "/**\n * author: Di (微信小程序开发工程师)\n * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)\n *               垂直微信小程序开发交流社区\n * \n * github地址: https://github.com/icindy/wxParse\n * \n * for: 微信小程序富文本解析\n * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184\n */\n\nvar __placeImgeUrlHttps = \"https\";\nvar __emojisReg = '';\nvar __emojisBaseSrc = '';\nvar __emojis = {};\nvar wxDiscode = require('wxDiscode.js');\nvar HTMLParser = require('htmlparser.js');\n// Empty Elements - HTML 5\nvar empty = makeMap(\"area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr\");\n// Block Elements - HTML 5\nvar block = makeMap(\"br,a,code,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video\");\n\n// Inline Elements - HTML 5\nvar inline = makeMap(\"abbr,acronym,applet,b,basefont,bdo,big,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var\");\n\n// Elements that you can, intentionally, leave open\n// (and which close themselves)\nvar closeSelf = makeMap(\"colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr\");\n\n// Attributes that have their values filled in disabled=\"disabled\"\nvar fillAttrs = makeMap(\"checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected\");\n\n// Special Elements (can contain anything)\nvar special = makeMap(\"wxxxcode-style,script,style,view,scroll-view,block\");\nfunction makeMap(str) {\n    var obj = {}, items = str.split(\",\");\n    for (var i = 0; i < items.length; i++)\n        obj[items[i]] = true;\n    return obj;\n}\n\nfunction q(v) {\n    return '\"' + v + '\"';\n}\n\nfunction removeDOCTYPE(html) {\n    return html\n        .replace(/<\\?xml.*\\?>\\n/, '')\n        .replace(/<!doctype.*\\>\\n/, '')\n        .replace(/<!DOCTYPE.*\\>\\n/, '');\n}\n\n\nfunction html2json(html, bindName) {\n    //处理字符串\n    html = removeDOCTYPE(html);\n    html = wxDiscode.strDiscode(html);\n    //生成node节点\n    var bufArray = [];\n    var results = {\n        node: bindName,\n        nodes: [],\n        images:[],\n        imageUrls:[]\n    };\n    HTMLParser(html, {\n        start: function (tag, attrs, unary) {\n            //debug(tag, attrs, unary);\n            // node for this element\n            var node = {\n                node: 'element',\n                tag: tag,\n            };\n\n            if (block[tag]) {\n                node.tagType = \"block\";\n            } else if (inline[tag]) {\n                node.tagType = \"inline\";\n            } else if (closeSelf[tag]) {\n                node.tagType = \"closeSelf\";\n            }\n\n            if (attrs.length !== 0) {\n                node.attr = attrs.reduce(function (pre, attr) {\n                    var name = attr.name;\n                    var value = attr.value;\n                    if (name == 'class') {\n                        console.dir(value);\n                        //  value = value.join(\"\")\n                        node.classStr = value;\n                    }\n                    // has multi attibutes\n                    // make it array of attribute\n                    if (name == 'style') {\n                        console.dir(value);\n                        //  value = value.join(\"\")\n                        node.styleStr = value;\n                    }\n                    if (value.match(/ /)) {\n                        value = value.split(' ');\n                    }\n                    \n\n                    // if attr already exists\n                    // merge it\n                    if (pre[name]) {\n                        if (Array.isArray(pre[name])) {\n                            // already array, push to last\n                            pre[name].push(value);\n                        } else {\n                            // single value, make it array\n                            pre[name] = [pre[name], value];\n                        }\n                    } else {\n                        // not exist, put it\n                        pre[name] = value;\n                    }\n\n                    return pre;\n                }, {});\n            }\n\n            //对img添加额外数据\n            if (node.tag === 'img') {\n                node.imgIndex = results.images.length;\n                var imgUrl = node.attr.src;\n                imgUrl = wxDiscode.urlToHttpUrl(imgUrl, __placeImgeUrlHttps);\n                node.attr.src = imgUrl;\n                node.from = bindName;\n                results.images.push(node);\n                results.imageUrls.push(imgUrl);\n            }\n\n            if (unary) {\n                // if this tag dosen't have end tag\n                // like <img src=\"hoge.png\"/>\n                // add to parents\n                var parent = bufArray[0] || results;\n                if (parent.nodes === undefined) {\n                    parent.nodes = [];\n                }\n                parent.nodes.push(node);\n            } else {\n                bufArray.unshift(node);\n            }\n        },\n        end: function (tag) {\n            //debug(tag);\n            // merge into parent tag\n            var node = bufArray.shift();\n            if (node.tag !== tag) console.error('invalid state: mismatch end tag');\n\n            if (bufArray.length === 0) {\n                results.nodes.push(node);\n            } else {\n                var parent = bufArray[0];\n                if (parent.nodes === undefined) {\n                    parent.nodes = [];\n                }\n                parent.nodes.push(node);\n            }\n        },\n        chars: function (text) {\n            //debug(text);\n            var node = {\n                node: 'text',\n                text: text,\n                textArray:transEmojiStr(text)\n            };\n            \n            if (bufArray.length === 0) {\n                results.nodes.push(node);\n            } else {\n                var parent = bufArray[0];\n                if (parent.nodes === undefined) {\n                    parent.nodes = [];\n                }\n                parent.nodes.push(node);\n            }\n        },\n        comment: function (text) {\n            //debug(text);\n            var node = {\n                node: 'comment',\n                text: text,\n            };\n            var parent = bufArray[0];\n            if (parent.nodes === undefined) {\n                parent.nodes = [];\n            }\n            parent.nodes.push(node);\n        },\n    });\n    return results;\n};\n\nfunction transEmojiStr(str){\n  // var eReg = new RegExp(\"[\"+__reg+' '+\"]\");\n//   str = str.replace(/\\[([^\\[\\]]+)\\]/g,':$1:')\n  \n  var emojiObjs = [];\n  //如果正则表达式为空\n  if(__emojisReg.length == 0 || !__emojis){\n      var emojiObj = {}\n      emojiObj.node = \"text\";\n      emojiObj.text = str;\n      array = [emojiObj];\n      return array;\n  }\n  //这个地方需要调整\n  str = str.replace(/\\[([^\\[\\]]+)\\]/g,':$1:')\n  var eReg = new RegExp(\"[:]\");\n  var array = str.split(eReg);\n  for(var i = 0; i < array.length; i++){\n    var ele = array[i];\n    var emojiObj = {};\n    if(__emojis[ele]){\n      emojiObj.node = \"element\";\n      emojiObj.tag = \"emoji\";\n      emojiObj.text = __emojis[ele];\n      emojiObj.baseSrc= __emojisBaseSrc;\n    }else{\n      emojiObj.node = \"text\";\n      emojiObj.text = ele;\n    }\n    emojiObjs.push(emojiObj);\n  }\n  \n  return emojiObjs;\n}\n\nfunction emojisInit(reg='',baseSrc=\"/wxParse/emojis/\",emojis){\n    __emojisReg = reg;\n    __emojisBaseSrc=baseSrc;\n    __emojis=emojis;\n}\n\nmodule.exports = {\n    html2json: html2json,\n    emojisInit:emojisInit\n};\n\n"
  },
  {
    "path": "lib/wxParse/htmlparser.js",
    "content": "/**\n * author: Di (微信小程序开发工程师)\n * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)\n *               垂直微信小程序开发交流社区\n * \n * github地址: https://github.com/icindy/wxParse\n * \n * for: 微信小程序富文本解析\n * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184\n */\n// Regular Expressions for parsing tags and attributes\nvar startTag = /^<([-A-Za-z0-9_]+)((?:\\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\\s*=\\s*(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>\\s]+))?)*)\\s*(\\/?)>/,\n\tendTag = /^<\\/([-A-Za-z0-9_]+)[^>]*>/,\n\tattr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\\s*=\\s*(?:(?:\"((?:\\\\.|[^\"])*)\")|(?:'((?:\\\\.|[^'])*)')|([^>\\s]+)))?/g;\n\n// Empty Elements - HTML 5\nvar empty = makeMap(\"area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr\");\n\n// Block Elements - HTML 5\nvar block = makeMap(\"a,address,code,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video\");\n\n// Inline Elements - HTML 5\nvar inline = makeMap(\"abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var\");\n\n// Elements that you can, intentionally, leave open\n// (and which close themselves)\nvar closeSelf = makeMap(\"colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr\");\n\n// Attributes that have their values filled in disabled=\"disabled\"\nvar fillAttrs = makeMap(\"checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected\");\n\n// Special Elements (can contain anything)\nvar special = makeMap(\"wxxxcode-style,script,style,view,scroll-view,block\");\n\nfunction HTMLParser(html, handler) {\n\tvar index, chars, match, stack = [], last = html;\n\tstack.last = function () {\n\t\treturn this[this.length - 1];\n\t};\n\n\twhile (html) {\n\t\tchars = true;\n\n\t\t// Make sure we're not in a script or style element\n\t\tif (!stack.last() || !special[stack.last()]) {\n\n\t\t\t// Comment\n\t\t\tif (html.indexOf(\"<!--\") == 0) {\n\t\t\t\tindex = html.indexOf(\"-->\");\n\n\t\t\t\tif (index >= 0) {\n\t\t\t\t\tif (handler.comment)\n\t\t\t\t\t\thandler.comment(html.substring(4, index));\n\t\t\t\t\thtml = html.substring(index + 3);\n\t\t\t\t\tchars = false;\n\t\t\t\t}\n\n\t\t\t\t// end tag\n\t\t\t} else if (html.indexOf(\"</\") == 0) {\n\t\t\t\tmatch = html.match(endTag);\n\n\t\t\t\tif (match) {\n\t\t\t\t\thtml = html.substring(match[0].length);\n\t\t\t\t\tmatch[0].replace(endTag, parseEndTag);\n\t\t\t\t\tchars = false;\n\t\t\t\t}\n\n\t\t\t\t// start tag\n\t\t\t} else if (html.indexOf(\"<\") == 0) {\n\t\t\t\tmatch = html.match(startTag);\n\n\t\t\t\tif (match) {\n\t\t\t\t\thtml = html.substring(match[0].length);\n\t\t\t\t\tmatch[0].replace(startTag, parseStartTag);\n\t\t\t\t\tchars = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (chars) {\n\t\t\t\tindex = html.indexOf(\"<\");\n\n\t\t\t\tvar text = index < 0 ? html : html.substring(0, index);\n\t\t\t\thtml = index < 0 ? \"\" : html.substring(index);\n\n\t\t\t\tif (handler.chars)\n\t\t\t\t\thandler.chars(text);\n\t\t\t}\n\n\t\t} else {\n\n\t\t\thtml = html.replace(new RegExp(\"([\\\\s\\\\S]*?)<\\/\" + stack.last() + \"[^>]*>\"), function (all, text) {\n\t\t\t\ttext = text.replace(/<!--([\\s\\S]*?)-->|<!\\[CDATA\\[([\\s\\S]*?)]]>/g, \"$1$2\");\n\t\t\t\tif (handler.chars)\n\t\t\t\t\thandler.chars(text);\n\n\t\t\t\treturn \"\";\n\t\t\t});\n\n\n\t\t\tparseEndTag(\"\", stack.last());\n\t\t}\n\n\t\tif (html == last)\n\t\t\tthrow \"Parse Error: \" + html;\n\t\tlast = html;\n\t}\n\n\t// Clean up any remaining tags\n\tparseEndTag();\n\n\tfunction parseStartTag(tag, tagName, rest, unary) {\n\t\ttagName = tagName.toLowerCase();\n\n\t\tif (block[tagName]) {\n\t\t\twhile (stack.last() && inline[stack.last()]) {\n\t\t\t\tparseEndTag(\"\", stack.last());\n\t\t\t}\n\t\t}\n\n\t\tif (closeSelf[tagName] && stack.last() == tagName) {\n\t\t\tparseEndTag(\"\", tagName);\n\t\t}\n\n\t\tunary = empty[tagName] || !!unary;\n\n\t\tif (!unary)\n\t\t\tstack.push(tagName);\n\n\t\tif (handler.start) {\n\t\t\tvar attrs = [];\n\n\t\t\trest.replace(attr, function (match, name) {\n\t\t\t\tvar value = arguments[2] ? arguments[2] :\n\t\t\t\t\targuments[3] ? arguments[3] :\n\t\t\t\t\t\targuments[4] ? arguments[4] :\n\t\t\t\t\t\t\tfillAttrs[name] ? name : \"\";\n\n\t\t\t\tattrs.push({\n\t\t\t\t\tname: name,\n\t\t\t\t\tvalue: value,\n\t\t\t\t\tescaped: value.replace(/(^|[^\\\\])\"/g, '$1\\\\\\\"') //\"\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tif (handler.start) {\n\t\t\t\thandler.start(tagName, attrs, unary);\n\t\t\t}\n\n\t\t}\n\t}\n\n\tfunction parseEndTag(tag, tagName) {\n\t\t// If no tag name is provided, clean shop\n\t\tif (!tagName)\n\t\t\tvar pos = 0;\n\n\t\t// Find the closest opened tag of the same type\n\t\telse\n\t\t\tfor (var pos = stack.length - 1; pos >= 0; pos--)\n\t\t\t\tif (stack[pos] == tagName)\n\t\t\t\t\tbreak;\n\n\t\tif (pos >= 0) {\n\t\t\t// Close all the open elements, up the stack\n\t\t\tfor (var i = stack.length - 1; i >= pos; i--)\n\t\t\t\tif (handler.end)\n\t\t\t\t\thandler.end(stack[i]);\n\n\t\t\t// Remove the open elements from the stack\n\t\t\tstack.length = pos;\n\t\t}\n\t}\n};\n\nfunction makeMap(str) {\n\tvar obj = {}, items = str.split(\",\");\n\tfor (var i = 0; i < items.length; i++)\n\t\tobj[items[i]] = true;\n\treturn obj;\n}\n\nmodule.exports = HTMLParser;\n"
  },
  {
    "path": "lib/wxParse/showdown.js",
    "content": "/**\n * author: Di (微信小程序开发工程师)\n * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)\n *               垂直微信小程序开发交流社区\n * \n * github地址: https://github.com/icindy/wxParse\n * \n * for: 微信小程序富文本解析\n * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184\n */\n\nfunction getDefaultOpts(simple) {\n  'use strict';\n\n  var defaultOptions = {\n    omitExtraWLInCodeBlocks: {\n      defaultValue: false,\n      describe: 'Omit the default extra whiteline added to code blocks',\n      type: 'boolean'\n    },\n    noHeaderId: {\n      defaultValue: false,\n      describe: 'Turn on/off generated header id',\n      type: 'boolean'\n    },\n    prefixHeaderId: {\n      defaultValue: false,\n      describe: 'Specify a prefix to generated header ids',\n      type: 'string'\n    },\n    headerLevelStart: {\n      defaultValue: false,\n      describe: 'The header blocks level start',\n      type: 'integer'\n    },\n    parseImgDimensions: {\n      defaultValue: false,\n      describe: 'Turn on/off image dimension parsing',\n      type: 'boolean'\n    },\n    simplifiedAutoLink: {\n      defaultValue: false,\n      describe: 'Turn on/off GFM autolink style',\n      type: 'boolean'\n    },\n    literalMidWordUnderscores: {\n      defaultValue: false,\n      describe: 'Parse midword underscores as literal underscores',\n      type: 'boolean'\n    },\n    strikethrough: {\n      defaultValue: false,\n      describe: 'Turn on/off strikethrough support',\n      type: 'boolean'\n    },\n    tables: {\n      defaultValue: false,\n      describe: 'Turn on/off tables support',\n      type: 'boolean'\n    },\n    tablesHeaderId: {\n      defaultValue: false,\n      describe: 'Add an id to table headers',\n      type: 'boolean'\n    },\n    ghCodeBlocks: {\n      defaultValue: true,\n      describe: 'Turn on/off GFM fenced code blocks support',\n      type: 'boolean'\n    },\n    tasklists: {\n      defaultValue: false,\n      describe: 'Turn on/off GFM tasklist support',\n      type: 'boolean'\n    },\n    smoothLivePreview: {\n      defaultValue: false,\n      describe: 'Prevents weird effects in live previews due to incomplete input',\n      type: 'boolean'\n    },\n    smartIndentationFix: {\n      defaultValue: false,\n      description: 'Tries to smartly fix identation in es6 strings',\n      type: 'boolean'\n    }\n  };\n  if (simple === false) {\n    return JSON.parse(JSON.stringify(defaultOptions));\n  }\n  var ret = {};\n  for (var opt in defaultOptions) {\n    if (defaultOptions.hasOwnProperty(opt)) {\n      ret[opt] = defaultOptions[opt].defaultValue;\n    }\n  }\n  return ret;\n}\n\n/**\n * Created by Tivie on 06-01-2015.\n */\n\n// Private properties\nvar showdown = {},\n    parsers = {},\n    extensions = {},\n    globalOptions = getDefaultOpts(true),\n    flavor = {\n      github: {\n        omitExtraWLInCodeBlocks:   true,\n        prefixHeaderId:            'user-content-',\n        simplifiedAutoLink:        true,\n        literalMidWordUnderscores: true,\n        strikethrough:             true,\n        tables:                    true,\n        tablesHeaderId:            true,\n        ghCodeBlocks:              true,\n        tasklists:                 true\n      },\n      vanilla: getDefaultOpts(true)\n    };\n\n/**\n * helper namespace\n * @type {{}}\n */\nshowdown.helper = {};\n\n/**\n * TODO LEGACY SUPPORT CODE\n * @type {{}}\n */\nshowdown.extensions = {};\n\n/**\n * Set a global option\n * @static\n * @param {string} key\n * @param {*} value\n * @returns {showdown}\n */\nshowdown.setOption = function (key, value) {\n  'use strict';\n  globalOptions[key] = value;\n  return this;\n};\n\n/**\n * Get a global option\n * @static\n * @param {string} key\n * @returns {*}\n */\nshowdown.getOption = function (key) {\n  'use strict';\n  return globalOptions[key];\n};\n\n/**\n * Get the global options\n * @static\n * @returns {{}}\n */\nshowdown.getOptions = function () {\n  'use strict';\n  return globalOptions;\n};\n\n/**\n * Reset global options to the default values\n * @static\n */\nshowdown.resetOptions = function () {\n  'use strict';\n  globalOptions = getDefaultOpts(true);\n};\n\n/**\n * Set the flavor showdown should use as default\n * @param {string} name\n */\nshowdown.setFlavor = function (name) {\n  'use strict';\n  if (flavor.hasOwnProperty(name)) {\n    var preset = flavor[name];\n    for (var option in preset) {\n      if (preset.hasOwnProperty(option)) {\n        globalOptions[option] = preset[option];\n      }\n    }\n  }\n};\n\n/**\n * Get the default options\n * @static\n * @param {boolean} [simple=true]\n * @returns {{}}\n */\nshowdown.getDefaultOptions = function (simple) {\n  'use strict';\n  return getDefaultOpts(simple);\n};\n\n/**\n * Get or set a subParser\n *\n * subParser(name)       - Get a registered subParser\n * subParser(name, func) - Register a subParser\n * @static\n * @param {string} name\n * @param {function} [func]\n * @returns {*}\n */\nshowdown.subParser = function (name, func) {\n  'use strict';\n  if (showdown.helper.isString(name)) {\n    if (typeof func !== 'undefined') {\n      parsers[name] = func;\n    } else {\n      if (parsers.hasOwnProperty(name)) {\n        return parsers[name];\n      } else {\n        throw Error('SubParser named ' + name + ' not registered!');\n      }\n    }\n  }\n};\n\n/**\n * Gets or registers an extension\n * @static\n * @param {string} name\n * @param {object|function=} ext\n * @returns {*}\n */\nshowdown.extension = function (name, ext) {\n  'use strict';\n\n  if (!showdown.helper.isString(name)) {\n    throw Error('Extension \\'name\\' must be a string');\n  }\n\n  name = showdown.helper.stdExtName(name);\n\n  // Getter\n  if (showdown.helper.isUndefined(ext)) {\n    if (!extensions.hasOwnProperty(name)) {\n      throw Error('Extension named ' + name + ' is not registered!');\n    }\n    return extensions[name];\n\n    // Setter\n  } else {\n    // Expand extension if it's wrapped in a function\n    if (typeof ext === 'function') {\n      ext = ext();\n    }\n\n    // Ensure extension is an array\n    if (!showdown.helper.isArray(ext)) {\n      ext = [ext];\n    }\n\n    var validExtension = validate(ext, name);\n\n    if (validExtension.valid) {\n      extensions[name] = ext;\n    } else {\n      throw Error(validExtension.error);\n    }\n  }\n};\n\n/**\n * Gets all extensions registered\n * @returns {{}}\n */\nshowdown.getAllExtensions = function () {\n  'use strict';\n  return extensions;\n};\n\n/**\n * Remove an extension\n * @param {string} name\n */\nshowdown.removeExtension = function (name) {\n  'use strict';\n  delete extensions[name];\n};\n\n/**\n * Removes all extensions\n */\nshowdown.resetExtensions = function () {\n  'use strict';\n  extensions = {};\n};\n\n/**\n * Validate extension\n * @param {array} extension\n * @param {string} name\n * @returns {{valid: boolean, error: string}}\n */\nfunction validate(extension, name) {\n  'use strict';\n\n  var errMsg = (name) ? 'Error in ' + name + ' extension->' : 'Error in unnamed extension',\n    ret = {\n      valid: true,\n      error: ''\n    };\n\n  if (!showdown.helper.isArray(extension)) {\n    extension = [extension];\n  }\n\n  for (var i = 0; i < extension.length; ++i) {\n    var baseMsg = errMsg + ' sub-extension ' + i + ': ',\n        ext = extension[i];\n    if (typeof ext !== 'object') {\n      ret.valid = false;\n      ret.error = baseMsg + 'must be an object, but ' + typeof ext + ' given';\n      return ret;\n    }\n\n    if (!showdown.helper.isString(ext.type)) {\n      ret.valid = false;\n      ret.error = baseMsg + 'property \"type\" must be a string, but ' + typeof ext.type + ' given';\n      return ret;\n    }\n\n    var type = ext.type = ext.type.toLowerCase();\n\n    // normalize extension type\n    if (type === 'language') {\n      type = ext.type = 'lang';\n    }\n\n    if (type === 'html') {\n      type = ext.type = 'output';\n    }\n\n    if (type !== 'lang' && type !== 'output' && type !== 'listener') {\n      ret.valid = false;\n      ret.error = baseMsg + 'type ' + type + ' is not recognized. Valid values: \"lang/language\", \"output/html\" or \"listener\"';\n      return ret;\n    }\n\n    if (type === 'listener') {\n      if (showdown.helper.isUndefined(ext.listeners)) {\n        ret.valid = false;\n        ret.error = baseMsg + '. Extensions of type \"listener\" must have a property called \"listeners\"';\n        return ret;\n      }\n    } else {\n      if (showdown.helper.isUndefined(ext.filter) && showdown.helper.isUndefined(ext.regex)) {\n        ret.valid = false;\n        ret.error = baseMsg + type + ' extensions must define either a \"regex\" property or a \"filter\" method';\n        return ret;\n      }\n    }\n\n    if (ext.listeners) {\n      if (typeof ext.listeners !== 'object') {\n        ret.valid = false;\n        ret.error = baseMsg + '\"listeners\" property must be an object but ' + typeof ext.listeners + ' given';\n        return ret;\n      }\n      for (var ln in ext.listeners) {\n        if (ext.listeners.hasOwnProperty(ln)) {\n          if (typeof ext.listeners[ln] !== 'function') {\n            ret.valid = false;\n            ret.error = baseMsg + '\"listeners\" property must be an hash of [event name]: [callback]. listeners.' + ln +\n              ' must be a function but ' + typeof ext.listeners[ln] + ' given';\n            return ret;\n          }\n        }\n      }\n    }\n\n    if (ext.filter) {\n      if (typeof ext.filter !== 'function') {\n        ret.valid = false;\n        ret.error = baseMsg + '\"filter\" must be a function, but ' + typeof ext.filter + ' given';\n        return ret;\n      }\n    } else if (ext.regex) {\n      if (showdown.helper.isString(ext.regex)) {\n        ext.regex = new RegExp(ext.regex, 'g');\n      }\n      if (!ext.regex instanceof RegExp) {\n        ret.valid = false;\n        ret.error = baseMsg + '\"regex\" property must either be a string or a RegExp object, but ' + typeof ext.regex + ' given';\n        return ret;\n      }\n      if (showdown.helper.isUndefined(ext.replace)) {\n        ret.valid = false;\n        ret.error = baseMsg + '\"regex\" extensions must implement a replace string or function';\n        return ret;\n      }\n    }\n  }\n  return ret;\n}\n\n/**\n * Validate extension\n * @param {object} ext\n * @returns {boolean}\n */\nshowdown.validateExtension = function (ext) {\n  'use strict';\n\n  var validateExtension = validate(ext, null);\n  if (!validateExtension.valid) {\n    console.warn(validateExtension.error);\n    return false;\n  }\n  return true;\n};\n\n/**\n * showdownjs helper functions\n */\n\nif (!showdown.hasOwnProperty('helper')) {\n  showdown.helper = {};\n}\n\n/**\n * Check if var is string\n * @static\n * @param {string} a\n * @returns {boolean}\n */\nshowdown.helper.isString = function isString(a) {\n  'use strict';\n  return (typeof a === 'string' || a instanceof String);\n};\n\n/**\n * Check if var is a function\n * @static\n * @param {string} a\n * @returns {boolean}\n */\nshowdown.helper.isFunction = function isFunction(a) {\n  'use strict';\n  var getType = {};\n  return a && getType.toString.call(a) === '[object Function]';\n};\n\n/**\n * ForEach helper function\n * @static\n * @param {*} obj\n * @param {function} callback\n */\nshowdown.helper.forEach = function forEach(obj, callback) {\n  'use strict';\n  if (typeof obj.forEach === 'function') {\n    obj.forEach(callback);\n  } else {\n    for (var i = 0; i < obj.length; i++) {\n      callback(obj[i], i, obj);\n    }\n  }\n};\n\n/**\n * isArray helper function\n * @static\n * @param {*} a\n * @returns {boolean}\n */\nshowdown.helper.isArray = function isArray(a) {\n  'use strict';\n  return a.constructor === Array;\n};\n\n/**\n * Check if value is undefined\n * @static\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n */\nshowdown.helper.isUndefined = function isUndefined(value) {\n  'use strict';\n  return typeof value === 'undefined';\n};\n\n/**\n * Standardidize extension name\n * @static\n * @param {string} s extension name\n * @returns {string}\n */\nshowdown.helper.stdExtName = function (s) {\n  'use strict';\n  return s.replace(/[_-]||\\s/g, '').toLowerCase();\n};\n\nfunction escapeCharactersCallback(wholeMatch, m1) {\n  'use strict';\n  var charCodeToEscape = m1.charCodeAt(0);\n  return '~E' + charCodeToEscape + 'E';\n}\n\n/**\n * Callback used to escape characters when passing through String.replace\n * @static\n * @param {string} wholeMatch\n * @param {string} m1\n * @returns {string}\n */\nshowdown.helper.escapeCharactersCallback = escapeCharactersCallback;\n\n/**\n * Escape characters in a string\n * @static\n * @param {string} text\n * @param {string} charsToEscape\n * @param {boolean} afterBackslash\n * @returns {XML|string|void|*}\n */\nshowdown.helper.escapeCharacters = function escapeCharacters(text, charsToEscape, afterBackslash) {\n  'use strict';\n  // First we have to escape the escape characters so that\n  // we can build a character class out of them\n  var regexString = '([' + charsToEscape.replace(/([\\[\\]\\\\])/g, '\\\\$1') + '])';\n\n  if (afterBackslash) {\n    regexString = '\\\\\\\\' + regexString;\n  }\n\n  var regex = new RegExp(regexString, 'g');\n  text = text.replace(regex, escapeCharactersCallback);\n\n  return text;\n};\n\nvar rgxFindMatchPos = function (str, left, right, flags) {\n  'use strict';\n  var f = flags || '',\n    g = f.indexOf('g') > -1,\n    x = new RegExp(left + '|' + right, 'g' + f.replace(/g/g, '')),\n    l = new RegExp(left, f.replace(/g/g, '')),\n    pos = [],\n    t, s, m, start, end;\n\n  do {\n    t = 0;\n    while ((m = x.exec(str))) {\n      if (l.test(m[0])) {\n        if (!(t++)) {\n          s = x.lastIndex;\n          start = s - m[0].length;\n        }\n      } else if (t) {\n        if (!--t) {\n          end = m.index + m[0].length;\n          var obj = {\n            left: {start: start, end: s},\n            match: {start: s, end: m.index},\n            right: {start: m.index, end: end},\n            wholeMatch: {start: start, end: end}\n          };\n          pos.push(obj);\n          if (!g) {\n            return pos;\n          }\n        }\n      }\n    }\n  } while (t && (x.lastIndex = s));\n\n  return pos;\n};\n\n/**\n * matchRecursiveRegExp\n *\n * (c) 2007 Steven Levithan <stevenlevithan.com>\n * MIT License\n *\n * Accepts a string to search, a left and right format delimiter\n * as regex patterns, and optional regex flags. Returns an array\n * of matches, allowing nested instances of left/right delimiters.\n * Use the \"g\" flag to return all matches, otherwise only the\n * first is returned. Be careful to ensure that the left and\n * right format delimiters produce mutually exclusive matches.\n * Backreferences are not supported within the right delimiter\n * due to how it is internally combined with the left delimiter.\n * When matching strings whose format delimiters are unbalanced\n * to the left or right, the output is intentionally as a\n * conventional regex library with recursion support would\n * produce, e.g. \"<<x>\" and \"<x>>\" both produce [\"x\"] when using\n * \"<\" and \">\" as the delimiters (both strings contain a single,\n * balanced instance of \"<x>\").\n *\n * examples:\n * matchRecursiveRegExp(\"test\", \"\\\\(\", \"\\\\)\")\n * returns: []\n * matchRecursiveRegExp(\"<t<<e>><s>>t<>\", \"<\", \">\", \"g\")\n * returns: [\"t<<e>><s>\", \"\"]\n * matchRecursiveRegExp(\"<div id=\\\"x\\\">test</div>\", \"<div\\\\b[^>]*>\", \"</div>\", \"gi\")\n * returns: [\"test\"]\n */\nshowdown.helper.matchRecursiveRegExp = function (str, left, right, flags) {\n  'use strict';\n\n  var matchPos = rgxFindMatchPos (str, left, right, flags),\n    results = [];\n\n  for (var i = 0; i < matchPos.length; ++i) {\n    results.push([\n      str.slice(matchPos[i].wholeMatch.start, matchPos[i].wholeMatch.end),\n      str.slice(matchPos[i].match.start, matchPos[i].match.end),\n      str.slice(matchPos[i].left.start, matchPos[i].left.end),\n      str.slice(matchPos[i].right.start, matchPos[i].right.end)\n    ]);\n  }\n  return results;\n};\n\n/**\n *\n * @param {string} str\n * @param {string|function} replacement\n * @param {string} left\n * @param {string} right\n * @param {string} flags\n * @returns {string}\n */\nshowdown.helper.replaceRecursiveRegExp = function (str, replacement, left, right, flags) {\n  'use strict';\n\n  if (!showdown.helper.isFunction(replacement)) {\n    var repStr = replacement;\n    replacement = function () {\n      return repStr;\n    };\n  }\n\n  var matchPos = rgxFindMatchPos(str, left, right, flags),\n      finalStr = str,\n      lng = matchPos.length;\n\n  if (lng > 0) {\n    var bits = [];\n    if (matchPos[0].wholeMatch.start !== 0) {\n      bits.push(str.slice(0, matchPos[0].wholeMatch.start));\n    }\n    for (var i = 0; i < lng; ++i) {\n      bits.push(\n        replacement(\n          str.slice(matchPos[i].wholeMatch.start, matchPos[i].wholeMatch.end),\n          str.slice(matchPos[i].match.start, matchPos[i].match.end),\n          str.slice(matchPos[i].left.start, matchPos[i].left.end),\n          str.slice(matchPos[i].right.start, matchPos[i].right.end)\n        )\n      );\n      if (i < lng - 1) {\n        bits.push(str.slice(matchPos[i].wholeMatch.end, matchPos[i + 1].wholeMatch.start));\n      }\n    }\n    if (matchPos[lng - 1].wholeMatch.end < str.length) {\n      bits.push(str.slice(matchPos[lng - 1].wholeMatch.end));\n    }\n    finalStr = bits.join('');\n  }\n  return finalStr;\n};\n\n/**\n * POLYFILLS\n */\nif (showdown.helper.isUndefined(console)) {\n  console = {\n    warn: function (msg) {\n      'use strict';\n      alert(msg);\n    },\n    log: function (msg) {\n      'use strict';\n      alert(msg);\n    },\n    error: function (msg) {\n      'use strict';\n      throw msg;\n    }\n  };\n}\n\n/**\n * Created by Estevao on 31-05-2015.\n */\n\n/**\n * Showdown Converter class\n * @class\n * @param {object} [converterOptions]\n * @returns {Converter}\n */\nshowdown.Converter = function (converterOptions) {\n  'use strict';\n\n  var\n      /**\n       * Options used by this converter\n       * @private\n       * @type {{}}\n       */\n      options = {},\n\n      /**\n       * Language extensions used by this converter\n       * @private\n       * @type {Array}\n       */\n      langExtensions = [],\n\n      /**\n       * Output modifiers extensions used by this converter\n       * @private\n       * @type {Array}\n       */\n      outputModifiers = [],\n\n      /**\n       * Event listeners\n       * @private\n       * @type {{}}\n       */\n      listeners = {};\n\n  _constructor();\n\n  /**\n   * Converter constructor\n   * @private\n   */\n  function _constructor() {\n    converterOptions = converterOptions || {};\n\n    for (var gOpt in globalOptions) {\n      if (globalOptions.hasOwnProperty(gOpt)) {\n        options[gOpt] = globalOptions[gOpt];\n      }\n    }\n\n    // Merge options\n    if (typeof converterOptions === 'object') {\n      for (var opt in converterOptions) {\n        if (converterOptions.hasOwnProperty(opt)) {\n          options[opt] = converterOptions[opt];\n        }\n      }\n    } else {\n      throw Error('Converter expects the passed parameter to be an object, but ' + typeof converterOptions +\n      ' was passed instead.');\n    }\n\n    if (options.extensions) {\n      showdown.helper.forEach(options.extensions, _parseExtension);\n    }\n  }\n\n  /**\n   * Parse extension\n   * @param {*} ext\n   * @param {string} [name='']\n   * @private\n   */\n  function _parseExtension(ext, name) {\n\n    name = name || null;\n    // If it's a string, the extension was previously loaded\n    if (showdown.helper.isString(ext)) {\n      ext = showdown.helper.stdExtName(ext);\n      name = ext;\n\n      // LEGACY_SUPPORT CODE\n      if (showdown.extensions[ext]) {\n        console.warn('DEPRECATION WARNING: ' + ext + ' is an old extension that uses a deprecated loading method.' +\n          'Please inform the developer that the extension should be updated!');\n        legacyExtensionLoading(showdown.extensions[ext], ext);\n        return;\n      // END LEGACY SUPPORT CODE\n\n      } else if (!showdown.helper.isUndefined(extensions[ext])) {\n        ext = extensions[ext];\n\n      } else {\n        throw Error('Extension \"' + ext + '\" could not be loaded. It was either not found or is not a valid extension.');\n      }\n    }\n\n    if (typeof ext === 'function') {\n      ext = ext();\n    }\n\n    if (!showdown.helper.isArray(ext)) {\n      ext = [ext];\n    }\n\n    var validExt = validate(ext, name);\n    if (!validExt.valid) {\n      throw Error(validExt.error);\n    }\n\n    for (var i = 0; i < ext.length; ++i) {\n      switch (ext[i].type) {\n\n        case 'lang':\n          langExtensions.push(ext[i]);\n          break;\n\n        case 'output':\n          outputModifiers.push(ext[i]);\n          break;\n      }\n      if (ext[i].hasOwnProperty(listeners)) {\n        for (var ln in ext[i].listeners) {\n          if (ext[i].listeners.hasOwnProperty(ln)) {\n            listen(ln, ext[i].listeners[ln]);\n          }\n        }\n      }\n    }\n\n  }\n\n  /**\n   * LEGACY_SUPPORT\n   * @param {*} ext\n   * @param {string} name\n   */\n  function legacyExtensionLoading(ext, name) {\n    if (typeof ext === 'function') {\n      ext = ext(new showdown.Converter());\n    }\n    if (!showdown.helper.isArray(ext)) {\n      ext = [ext];\n    }\n    var valid = validate(ext, name);\n\n    if (!valid.valid) {\n      throw Error(valid.error);\n    }\n\n    for (var i = 0; i < ext.length; ++i) {\n      switch (ext[i].type) {\n        case 'lang':\n          langExtensions.push(ext[i]);\n          break;\n        case 'output':\n          outputModifiers.push(ext[i]);\n          break;\n        default:// should never reach here\n          throw Error('Extension loader error: Type unrecognized!!!');\n      }\n    }\n  }\n\n  /**\n   * Listen to an event\n   * @param {string} name\n   * @param {function} callback\n   */\n  function listen(name, callback) {\n    if (!showdown.helper.isString(name)) {\n      throw Error('Invalid argument in converter.listen() method: name must be a string, but ' + typeof name + ' given');\n    }\n\n    if (typeof callback !== 'function') {\n      throw Error('Invalid argument in converter.listen() method: callback must be a function, but ' + typeof callback + ' given');\n    }\n\n    if (!listeners.hasOwnProperty(name)) {\n      listeners[name] = [];\n    }\n    listeners[name].push(callback);\n  }\n\n  function rTrimInputText(text) {\n    var rsp = text.match(/^\\s*/)[0].length,\n        rgx = new RegExp('^\\\\s{0,' + rsp + '}', 'gm');\n    return text.replace(rgx, '');\n  }\n\n  /**\n   * Dispatch an event\n   * @private\n   * @param {string} evtName Event name\n   * @param {string} text Text\n   * @param {{}} options Converter Options\n   * @param {{}} globals\n   * @returns {string}\n   */\n  this._dispatch = function dispatch (evtName, text, options, globals) {\n    if (listeners.hasOwnProperty(evtName)) {\n      for (var ei = 0; ei < listeners[evtName].length; ++ei) {\n        var nText = listeners[evtName][ei](evtName, text, this, options, globals);\n        if (nText && typeof nText !== 'undefined') {\n          text = nText;\n        }\n      }\n    }\n    return text;\n  };\n\n  /**\n   * Listen to an event\n   * @param {string} name\n   * @param {function} callback\n   * @returns {showdown.Converter}\n   */\n  this.listen = function (name, callback) {\n    listen(name, callback);\n    return this;\n  };\n\n  /**\n   * Converts a markdown string into HTML\n   * @param {string} text\n   * @returns {*}\n   */\n  this.makeHtml = function (text) {\n    //check if text is not falsy\n    if (!text) {\n      return text;\n    }\n\n    var globals = {\n      gHtmlBlocks:     [],\n      gHtmlMdBlocks:   [],\n      gHtmlSpans:      [],\n      gUrls:           {},\n      gTitles:         {},\n      gDimensions:     {},\n      gListLevel:      0,\n      hashLinkCounts:  {},\n      langExtensions:  langExtensions,\n      outputModifiers: outputModifiers,\n      converter:       this,\n      ghCodeBlocks:    []\n    };\n\n    // attacklab: Replace ~ with ~T\n    // This lets us use tilde as an escape char to avoid md5 hashes\n    // The choice of character is arbitrary; anything that isn't\n    // magic in Markdown will work.\n    text = text.replace(/~/g, '~T');\n\n    // attacklab: Replace $ with ~D\n    // RegExp interprets $ as a special character\n    // when it's in a replacement string\n    text = text.replace(/\\$/g, '~D');\n\n    // Standardize line endings\n    text = text.replace(/\\r\\n/g, '\\n'); // DOS to Unix\n    text = text.replace(/\\r/g, '\\n'); // Mac to Unix\n\n    if (options.smartIndentationFix) {\n      text = rTrimInputText(text);\n    }\n\n    // Make sure text begins and ends with a couple of newlines:\n    //text = '\\n\\n' + text + '\\n\\n';\n    text = text;\n    // detab\n    text = showdown.subParser('detab')(text, options, globals);\n\n    // stripBlankLines\n    text = showdown.subParser('stripBlankLines')(text, options, globals);\n\n    //run languageExtensions\n    showdown.helper.forEach(langExtensions, function (ext) {\n      text = showdown.subParser('runExtension')(ext, text, options, globals);\n    });\n\n    // run the sub parsers\n    text = showdown.subParser('hashPreCodeTags')(text, options, globals);\n    text = showdown.subParser('githubCodeBlocks')(text, options, globals);\n    text = showdown.subParser('hashHTMLBlocks')(text, options, globals);\n    text = showdown.subParser('hashHTMLSpans')(text, options, globals);\n    text = showdown.subParser('stripLinkDefinitions')(text, options, globals);\n    text = showdown.subParser('blockGamut')(text, options, globals);\n    text = showdown.subParser('unhashHTMLSpans')(text, options, globals);\n    text = showdown.subParser('unescapeSpecialChars')(text, options, globals);\n\n    // attacklab: Restore dollar signs\n    text = text.replace(/~D/g, '$$');\n\n    // attacklab: Restore tildes\n    text = text.replace(/~T/g, '~');\n\n    // Run output modifiers\n    showdown.helper.forEach(outputModifiers, function (ext) {\n      text = showdown.subParser('runExtension')(ext, text, options, globals);\n    });\n    return text;\n  };\n\n  /**\n   * Set an option of this Converter instance\n   * @param {string} key\n   * @param {*} value\n   */\n  this.setOption = function (key, value) {\n    options[key] = value;\n  };\n\n  /**\n   * Get the option of this Converter instance\n   * @param {string} key\n   * @returns {*}\n   */\n  this.getOption = function (key) {\n    return options[key];\n  };\n\n  /**\n   * Get the options of this Converter instance\n   * @returns {{}}\n   */\n  this.getOptions = function () {\n    return options;\n  };\n\n  /**\n   * Add extension to THIS converter\n   * @param {{}} extension\n   * @param {string} [name=null]\n   */\n  this.addExtension = function (extension, name) {\n    name = name || null;\n    _parseExtension(extension, name);\n  };\n\n  /**\n   * Use a global registered extension with THIS converter\n   * @param {string} extensionName Name of the previously registered extension\n   */\n  this.useExtension = function (extensionName) {\n    _parseExtension(extensionName);\n  };\n\n  /**\n   * Set the flavor THIS converter should use\n   * @param {string} name\n   */\n  this.setFlavor = function (name) {\n    if (flavor.hasOwnProperty(name)) {\n      var preset = flavor[name];\n      for (var option in preset) {\n        if (preset.hasOwnProperty(option)) {\n          options[option] = preset[option];\n        }\n      }\n    }\n  };\n\n  /**\n   * Remove an extension from THIS converter.\n   * Note: This is a costly operation. It's better to initialize a new converter\n   * and specify the extensions you wish to use\n   * @param {Array} extension\n   */\n  this.removeExtension = function (extension) {\n    if (!showdown.helper.isArray(extension)) {\n      extension = [extension];\n    }\n    for (var a = 0; a < extension.length; ++a) {\n      var ext = extension[a];\n      for (var i = 0; i < langExtensions.length; ++i) {\n        if (langExtensions[i] === ext) {\n          langExtensions[i].splice(i, 1);\n        }\n      }\n      for (var ii = 0; ii < outputModifiers.length; ++i) {\n        if (outputModifiers[ii] === ext) {\n          outputModifiers[ii].splice(i, 1);\n        }\n      }\n    }\n  };\n\n  /**\n   * Get all extension of THIS converter\n   * @returns {{language: Array, output: Array}}\n   */\n  this.getAllExtensions = function () {\n    return {\n      language: langExtensions,\n      output: outputModifiers\n    };\n  };\n};\n\n/**\n * Turn Markdown link shortcuts into XHTML <a> tags.\n */\nshowdown.subParser('anchors', function (text, options, globals) {\n  'use strict';\n\n  text = globals.converter._dispatch('anchors.before', text, options, globals);\n\n  var writeAnchorTag = function (wholeMatch, m1, m2, m3, m4, m5, m6, m7) {\n    if (showdown.helper.isUndefined(m7)) {\n      m7 = '';\n    }\n    wholeMatch = m1;\n    var linkText = m2,\n        linkId = m3.toLowerCase(),\n        url = m4,\n        title = m7;\n\n    if (!url) {\n      if (!linkId) {\n        // lower-case and turn embedded newlines into spaces\n        linkId = linkText.toLowerCase().replace(/ ?\\n/g, ' ');\n      }\n      url = '#' + linkId;\n\n      if (!showdown.helper.isUndefined(globals.gUrls[linkId])) {\n        url = globals.gUrls[linkId];\n        if (!showdown.helper.isUndefined(globals.gTitles[linkId])) {\n          title = globals.gTitles[linkId];\n        }\n      } else {\n        if (wholeMatch.search(/\\(\\s*\\)$/m) > -1) {\n          // Special case for explicit empty url\n          url = '';\n        } else {\n          return wholeMatch;\n        }\n      }\n    }\n\n    url = showdown.helper.escapeCharacters(url, '*_', false);\n    var result = '<a href=\"' + url + '\"';\n\n    if (title !== '' && title !== null) {\n      title = title.replace(/\"/g, '&quot;');\n      title = showdown.helper.escapeCharacters(title, '*_', false);\n      result += ' title=\"' + title + '\"';\n    }\n\n    result += '>' + linkText + '</a>';\n\n    return result;\n  };\n\n  // First, handle reference-style links: [link text] [id]\n  /*\n   text = text.replace(/\n   (\t\t\t\t\t\t\t// wrap whole match in $1\n   \\[\n   (\n   (?:\n   \\[[^\\]]*\\]\t\t// allow brackets nested one level\n   |\n   [^\\[]\t\t\t// or anything else\n   )*\n   )\n   \\]\n\n   [ ]?\t\t\t\t\t// one optional space\n   (?:\\n[ ]*)?\t\t\t\t// one optional newline followed by spaces\n\n   \\[\n   (.*?)\t\t\t\t\t// id = $3\n   \\]\n   )()()()()\t\t\t\t\t// pad remaining backreferences\n   /g,_DoAnchors_callback);\n   */\n  text = text.replace(/(\\[((?:\\[[^\\]]*]|[^\\[\\]])*)][ ]?(?:\\n[ ]*)?\\[(.*?)])()()()()/g, writeAnchorTag);\n\n  //\n  // Next, inline-style links: [link text](url \"optional title\")\n  //\n\n  /*\n   text = text.replace(/\n   (\t\t\t\t\t\t// wrap whole match in $1\n   \\[\n   (\n   (?:\n   \\[[^\\]]*\\]\t// allow brackets nested one level\n   |\n   [^\\[\\]]\t\t\t// or anything else\n   )\n   )\n   \\]\n   \\(\t\t\t\t\t\t// literal paren\n   [ \\t]*\n   ()\t\t\t\t\t\t// no id, so leave $3 empty\n   <?(.*?)>?\t\t\t\t// href = $4\n   [ \\t]*\n   (\t\t\t\t\t\t// $5\n   (['\"])\t\t\t\t// quote char = $6\n   (.*?)\t\t\t\t// Title = $7\n   \\6\t\t\t\t\t// matching quote\n   [ \\t]*\t\t\t\t// ignore any spaces/tabs between closing quote and )\n   )?\t\t\t\t\t\t// title is optional\n   \\)\n   )\n   /g,writeAnchorTag);\n   */\n  text = text.replace(/(\\[((?:\\[[^\\]]*]|[^\\[\\]])*)]\\([ \\t]*()<?(.*?(?:\\(.*?\\).*?)?)>?[ \\t]*((['\"])(.*?)\\6[ \\t]*)?\\))/g,\n                      writeAnchorTag);\n\n  //\n  // Last, handle reference-style shortcuts: [link text]\n  // These must come last in case you've also got [link test][1]\n  // or [link test](/foo)\n  //\n\n  /*\n   text = text.replace(/\n   (                // wrap whole match in $1\n   \\[\n   ([^\\[\\]]+)       // link text = $2; can't contain '[' or ']'\n   \\]\n   )()()()()()      // pad rest of backreferences\n   /g, writeAnchorTag);\n   */\n  text = text.replace(/(\\[([^\\[\\]]+)])()()()()()/g, writeAnchorTag);\n\n  text = globals.converter._dispatch('anchors.after', text, options, globals);\n  return text;\n});\n\nshowdown.subParser('autoLinks', function (text, options, globals) {\n  'use strict';\n\n  text = globals.converter._dispatch('autoLinks.before', text, options, globals);\n\n  var simpleURLRegex  = /\\b(((https?|ftp|dict):\\/\\/|www\\.)[^'\">\\s]+\\.[^'\">\\s]+)(?=\\s|$)(?![\"<>])/gi,\n      delimUrlRegex   = /<(((https?|ftp|dict):\\/\\/|www\\.)[^'\">\\s]+)>/gi,\n      simpleMailRegex = /(?:^|[ \\n\\t])([A-Za-z0-9!#$%&'*+-/=?^_`\\{|}~\\.]+@[-a-z0-9]+(\\.[-a-z0-9]+)*\\.[a-z]+)(?:$|[ \\n\\t])/gi,\n      delimMailRegex  = /<(?:mailto:)?([-.\\w]+@[-a-z0-9]+(\\.[-a-z0-9]+)*\\.[a-z]+)>/gi;\n\n  text = text.replace(delimUrlRegex, replaceLink);\n  text = text.replace(delimMailRegex, replaceMail);\n  // simpleURLRegex  = /\\b(((https?|ftp|dict):\\/\\/|www\\.)[-.+~:?#@!$&'()*,;=[\\]\\w]+)\\b/gi,\n  // Email addresses: <address@domain.foo>\n\n  if (options.simplifiedAutoLink) {\n    text = text.replace(simpleURLRegex, replaceLink);\n    text = text.replace(simpleMailRegex, replaceMail);\n  }\n\n  function replaceLink(wm, link) {\n    var lnkTxt = link;\n    if (/^www\\./i.test(link)) {\n      link = link.replace(/^www\\./i, 'http://www.');\n    }\n    return '<a href=\"' + link + '\">' + lnkTxt + '</a>';\n  }\n\n  function replaceMail(wholeMatch, m1) {\n    var unescapedStr = showdown.subParser('unescapeSpecialChars')(m1);\n    return showdown.subParser('encodeEmailAddress')(unescapedStr);\n  }\n\n  text = globals.converter._dispatch('autoLinks.after', text, options, globals);\n\n  return text;\n});\n\n/**\n * These are all the transformations that form block-level\n * tags like paragraphs, headers, and list items.\n */\nshowdown.subParser('blockGamut', function (text, options, globals) {\n  'use strict';\n\n  text = globals.converter._dispatch('blockGamut.before', text, options, globals);\n\n  // we parse blockquotes first so that we can have headings and hrs\n  // inside blockquotes\n  text = showdown.subParser('blockQuotes')(text, options, globals);\n  text = showdown.subParser('headers')(text, options, globals);\n\n  // Do Horizontal Rules:\n  var key = showdown.subParser('hashBlock')('<hr />', options, globals);\n  text = text.replace(/^[ ]{0,2}([ ]?\\*[ ]?){3,}[ \\t]*$/gm, key);\n  text = text.replace(/^[ ]{0,2}([ ]?\\-[ ]?){3,}[ \\t]*$/gm, key);\n  text = text.replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \\t]*$/gm, key);\n\n  text = showdown.subParser('lists')(text, options, globals);\n  text = showdown.subParser('codeBlocks')(text, options, globals);\n  text = showdown.subParser('tables')(text, options, globals);\n\n  // We already ran _HashHTMLBlocks() before, in Markdown(), but that\n  // was to escape raw HTML in the original Markdown source. This time,\n  // we're escaping the markup we've just created, so that we don't wrap\n  // <p> tags around block-level tags.\n  text = showdown.subParser('hashHTMLBlocks')(text, options, globals);\n  text = showdown.subParser('paragraphs')(text, options, globals);\n\n  text = globals.converter._dispatch('blockGamut.after', text, options, globals);\n\n  return text;\n});\n\nshowdown.subParser('blockQuotes', function (text, options, globals) {\n  'use strict';\n\n  text = globals.converter._dispatch('blockQuotes.before', text, options, globals);\n  /*\n   text = text.replace(/\n   (\t\t\t\t\t\t\t\t// Wrap whole match in $1\n   (\n   ^[ \\t]*>[ \\t]?\t\t\t// '>' at the start of a line\n   .+\\n\t\t\t\t\t// rest of the first line\n   (.+\\n)*\t\t\t\t\t// subsequent consecutive lines\n   \\n*\t\t\t\t\t\t// blanks\n   )+\n   )\n   /gm, function(){...});\n   */\n\n  text = text.replace(/((^[ \\t]{0,3}>[ \\t]?.+\\n(.+\\n)*\\n*)+)/gm, function (wholeMatch, m1) {\n    var bq = m1;\n\n    // attacklab: hack around Konqueror 3.5.4 bug:\n    // \"----------bug\".replace(/^-/g,\"\") == \"bug\"\n    bq = bq.replace(/^[ \\t]*>[ \\t]?/gm, '~0'); // trim one level of quoting\n\n    // attacklab: clean up hack\n    bq = bq.replace(/~0/g, '');\n\n    bq = bq.replace(/^[ \\t]+$/gm, ''); // trim whitespace-only lines\n    bq = showdown.subParser('githubCodeBlocks')(bq, options, globals);\n    bq = showdown.subParser('blockGamut')(bq, options, globals); // recurse\n\n    bq = bq.replace(/(^|\\n)/g, '$1  ');\n    // These leading spaces screw with <pre> content, so we need to fix that:\n    bq = bq.replace(/(\\s*<pre>[^\\r]+?<\\/pre>)/gm, function (wholeMatch, m1) {\n      var pre = m1;\n      // attacklab: hack around Konqueror 3.5.4 bug:\n      pre = pre.replace(/^  /mg, '~0');\n      pre = pre.replace(/~0/g, '');\n      return pre;\n    });\n\n    return showdown.subParser('hashBlock')('<blockquote>\\n' + bq + '\\n</blockquote>', options, globals);\n  });\n\n  text = globals.converter._dispatch('blockQuotes.after', text, options, globals);\n  return text;\n});\n\n/**\n * Process Markdown `<pre><code>` blocks.\n */\nshowdown.subParser('codeBlocks', function (text, options, globals) {\n  'use strict';\n\n  text = globals.converter._dispatch('codeBlocks.before', text, options, globals);\n  /*\n   text = text.replace(text,\n   /(?:\\n\\n|^)\n   (\t\t\t\t\t\t\t\t// $1 = the code block -- one or more lines, starting with a space/tab\n   (?:\n   (?:[ ]{4}|\\t)\t\t\t// Lines must start with a tab or a tab-width of spaces - attacklab: g_tab_width\n   .*\\n+\n   )+\n   )\n   (\\n*[ ]{0,3}[^ \\t\\n]|(?=~0))\t// attacklab: g_tab_width\n   /g,function(){...});\n   */\n\n  // attacklab: sentinel workarounds for lack of \\A and \\Z, safari\\khtml bug\n  text += '~0';\n\n  var pattern = /(?:\\n\\n|^)((?:(?:[ ]{4}|\\t).*\\n+)+)(\\n*[ ]{0,3}[^ \\t\\n]|(?=~0))/g;\n  text = text.replace(pattern, function (wholeMatch, m1, m2) {\n    var codeblock = m1,\n        nextChar = m2,\n        end = '\\n';\n\n    codeblock = showdown.subParser('outdent')(codeblock);\n    codeblock = showdown.subParser('encodeCode')(codeblock);\n    codeblock = showdown.subParser('detab')(codeblock);\n    codeblock = codeblock.replace(/^\\n+/g, ''); // trim leading newlines\n    codeblock = codeblock.replace(/\\n+$/g, ''); // trim trailing newlines\n\n    if (options.omitExtraWLInCodeBlocks) {\n      end = '';\n    }\n\n    codeblock = '<pre><code>' + codeblock + end + '</code></pre>';\n\n    return showdown.subParser('hashBlock')(codeblock, options, globals) + nextChar;\n  });\n\n  // attacklab: strip sentinel\n  text = text.replace(/~0/, '');\n\n  text = globals.converter._dispatch('codeBlocks.after', text, options, globals);\n  return text;\n});\n\n/**\n *\n *   *  Backtick quotes are used for <code></code> spans.\n *\n *   *  You can use multiple backticks as the delimiters if you want to\n *     include literal backticks in the code span. So, this input:\n *\n *         Just type ``foo `bar` baz`` at the prompt.\n *\n *       Will translate to:\n *\n *         <p>Just type <code>foo `bar` baz</code> at the prompt.</p>\n *\n *    There's no arbitrary limit to the number of backticks you\n *    can use as delimters. If you need three consecutive backticks\n *    in your code, use four for delimiters, etc.\n *\n *  *  You can use spaces to get literal backticks at the edges:\n *\n *         ... type `` `bar` `` ...\n *\n *       Turns to:\n *\n *         ... type <code>`bar`</code> ...\n */\nshowdown.subParser('codeSpans', function (text, options, globals) {\n  'use strict';\n\n  text = globals.converter._dispatch('codeSpans.before', text, options, globals);\n\n  /*\n   text = text.replace(/\n   (^|[^\\\\])\t\t\t\t\t// Character before opening ` can't be a backslash\n   (`+)\t\t\t\t\t\t// $2 = Opening run of `\n   (\t\t\t\t\t\t\t// $3 = The code block\n   [^\\r]*?\n   [^`]\t\t\t\t\t// attacklab: work around lack of lookbehind\n   )\n   \\2\t\t\t\t\t\t\t// Matching closer\n   (?!`)\n   /gm, function(){...});\n   */\n\n  if (typeof(text) === 'undefined') {\n    text = '';\n  }\n  text = text.replace(/(^|[^\\\\])(`+)([^\\r]*?[^`])\\2(?!`)/gm,\n    function (wholeMatch, m1, m2, m3) {\n      var c = m3;\n      c = c.replace(/^([ \\t]*)/g, '');\t// leading whitespace\n      c = c.replace(/[ \\t]*$/g, '');\t// trailing whitespace\n      c = showdown.subParser('encodeCode')(c);\n      return m1 + '<code>' + c + '</code>';\n    }\n  );\n\n  text = globals.converter._dispatch('codeSpans.after', text, options, globals);\n  return text;\n});\n\n/**\n * Convert all tabs to spaces\n */\nshowdown.subParser('detab', function (text) {\n  'use strict';\n\n  // expand first n-1 tabs\n  text = text.replace(/\\t(?=\\t)/g, '    '); // g_tab_width\n\n  // replace the nth with two sentinels\n  text = text.replace(/\\t/g, '~A~B');\n\n  // use the sentinel to anchor our regex so it doesn't explode\n  text = text.replace(/~B(.+?)~A/g, function (wholeMatch, m1) {\n    var leadingText = m1,\n        numSpaces = 4 - leadingText.length % 4;  // g_tab_width\n\n    // there *must* be a better way to do this:\n    for (var i = 0; i < numSpaces; i++) {\n      leadingText += ' ';\n    }\n\n    return leadingText;\n  });\n\n  // clean up sentinels\n  text = text.replace(/~A/g, '    ');  // g_tab_width\n  text = text.replace(/~B/g, '');\n\n  return text;\n\n});\n\n/**\n * Smart processing for ampersands and angle brackets that need to be encoded.\n */\nshowdown.subParser('encodeAmpsAndAngles', function (text) {\n  'use strict';\n  // Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin:\n  // http://bumppo.net/projects/amputator/\n  text = text.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\\w+);)/g, '&amp;');\n\n  // Encode naked <'s\n  text = text.replace(/<(?![a-z\\/?\\$!])/gi, '&lt;');\n\n  return text;\n});\n\n/**\n * Returns the string, with after processing the following backslash escape sequences.\n *\n * attacklab: The polite way to do this is with the new escapeCharacters() function:\n *\n *    text = escapeCharacters(text,\"\\\\\",true);\n *    text = escapeCharacters(text,\"`*_{}[]()>#+-.!\",true);\n *\n * ...but we're sidestepping its use of the (slow) RegExp constructor\n * as an optimization for Firefox.  This function gets called a LOT.\n */\nshowdown.subParser('encodeBackslashEscapes', function (text) {\n  'use strict';\n  text = text.replace(/\\\\(\\\\)/g, showdown.helper.escapeCharactersCallback);\n  text = text.replace(/\\\\([`*_{}\\[\\]()>#+-.!])/g, showdown.helper.escapeCharactersCallback);\n  return text;\n});\n\n/**\n * Encode/escape certain characters inside Markdown code runs.\n * The point is that in code, these characters are literals,\n * and lose their special Markdown meanings.\n */\nshowdown.subParser('encodeCode', function (text) {\n  'use strict';\n\n  // Encode all ampersands; HTML entities are not\n  // entities within a Markdown code span.\n  text = text.replace(/&/g, '&amp;');\n\n  // Do the angle bracket song and dance:\n  text = text.replace(/</g, '&lt;');\n  text = text.replace(/>/g, '&gt;');\n\n  // Now, escape characters that are magic in Markdown:\n  text = showdown.helper.escapeCharacters(text, '*_{}[]\\\\', false);\n\n  // jj the line above breaks this:\n  //---\n  //* Item\n  //   1. Subitem\n  //            special char: *\n  // ---\n\n  return text;\n});\n\n/**\n *  Input: an email address, e.g. \"foo@example.com\"\n *\n *  Output: the email address as a mailto link, with each character\n *    of the address encoded as either a decimal or hex entity, in\n *    the hopes of foiling most address harvesting spam bots. E.g.:\n *\n *    <a href=\"&#x6D;&#97;&#105;&#108;&#x74;&#111;:&#102;&#111;&#111;&#64;&#101;\n *       x&#x61;&#109;&#x70;&#108;&#x65;&#x2E;&#99;&#111;&#109;\">&#102;&#111;&#111;\n *       &#64;&#101;x&#x61;&#109;&#x70;&#108;&#x65;&#x2E;&#99;&#111;&#109;</a>\n *\n *  Based on a filter by Matthew Wickline, posted to the BBEdit-Talk\n *  mailing list: <http://tinyurl.com/yu7ue>\n *\n */\nshowdown.subParser('encodeEmailAddress', function (addr) {\n  'use strict';\n\n  var encode = [\n    function (ch) {\n      return '&#' + ch.charCodeAt(0) + ';';\n    },\n    function (ch) {\n      return '&#x' + ch.charCodeAt(0).toString(16) + ';';\n    },\n    function (ch) {\n      return ch;\n    }\n  ];\n\n  addr = 'mailto:' + addr;\n\n  addr = addr.replace(/./g, function (ch) {\n    if (ch === '@') {\n      // this *must* be encoded. I insist.\n      ch = encode[Math.floor(Math.random() * 2)](ch);\n    } else if (ch !== ':') {\n      // leave ':' alone (to spot mailto: later)\n      var r = Math.random();\n      // roughly 10% raw, 45% hex, 45% dec\n      ch = (\n        r > 0.9 ? encode[2](ch) : r > 0.45 ? encode[1](ch) : encode[0](ch)\n      );\n    }\n    return ch;\n  });\n\n  addr = '<a href=\"' + addr + '\">' + addr + '</a>';\n  addr = addr.replace(/\">.+:/g, '\">'); // strip the mailto: from the visible part\n\n  return addr;\n});\n\n/**\n * Within tags -- meaning between < and > -- encode [\\ ` * _] so they\n * don't conflict with their use in Markdown for code, italics and strong.\n */\nshowdown.subParser('escapeSpecialCharsWithinTagAttributes', function (text) {\n  'use strict';\n\n  // Build a regex to find HTML tags and comments.  See Friedl's\n  // \"Mastering Regular Expressions\", 2nd Ed., pp. 200-201.\n  var regex = /(<[a-z\\/!$](\"[^\"]*\"|'[^']*'|[^'\">])*>|<!(--.*?--\\s*)+>)/gi;\n\n  text = text.replace(regex, function (wholeMatch) {\n    var tag = wholeMatch.replace(/(.)<\\/?code>(?=.)/g, '$1`');\n    tag = showdown.helper.escapeCharacters(tag, '\\\\`*_', false);\n    return tag;\n  });\n\n  return text;\n});\n\n/**\n * Handle github codeblocks prior to running HashHTML so that\n * HTML contained within the codeblock gets escaped properly\n * Example:\n * ```ruby\n *     def hello_world(x)\n *       puts \"Hello, #{x}\"\n *     end\n * ```\n */\nshowdown.subParser('githubCodeBlocks', function (text, options, globals) {\n  'use strict';\n\n  // early exit if option is not enabled\n  if (!options.ghCodeBlocks) {\n    return text;\n  }\n\n  text = globals.converter._dispatch('githubCodeBlocks.before', text, options, globals);\n\n  text += '~0';\n\n  text = text.replace(/(?:^|\\n)```(.*)\\n([\\s\\S]*?)\\n```/g, function (wholeMatch, language, codeblock) {\n    var end = (options.omitExtraWLInCodeBlocks) ? '' : '\\n';\n\n    // First parse the github code block\n    codeblock = showdown.subParser('encodeCode')(codeblock);\n    codeblock = showdown.subParser('detab')(codeblock);\n    codeblock = codeblock.replace(/^\\n+/g, ''); // trim leading newlines\n    codeblock = codeblock.replace(/\\n+$/g, ''); // trim trailing whitespace\n\n    codeblock = '<pre><code' + (language ? ' class=\"' + language + ' language-' + language + '\"' : '') + '>' + codeblock + end + '</code></pre>';\n\n    codeblock = showdown.subParser('hashBlock')(codeblock, options, globals);\n\n    // Since GHCodeblocks can be false positives, we need to\n    // store the primitive text and the parsed text in a global var,\n    // and then return a token\n    return '\\n\\n~G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\\n\\n';\n  });\n\n  // attacklab: strip sentinel\n  text = text.replace(/~0/, '');\n\n  return globals.converter._dispatch('githubCodeBlocks.after', text, options, globals);\n});\n\nshowdown.subParser('hashBlock', function (text, options, globals) {\n  'use strict';\n  text = text.replace(/(^\\n+|\\n+$)/g, '');\n  return '\\n\\n~K' + (globals.gHtmlBlocks.push(text) - 1) + 'K\\n\\n';\n});\n\nshowdown.subParser('hashElement', function (text, options, globals) {\n  'use strict';\n\n  return function (wholeMatch, m1) {\n    var blockText = m1;\n\n    // Undo double lines\n    blockText = blockText.replace(/\\n\\n/g, '\\n');\n    blockText = blockText.replace(/^\\n/, '');\n\n    // strip trailing blank lines\n    blockText = blockText.replace(/\\n+$/g, '');\n\n    // Replace the element text with a marker (\"~KxK\" where x is its key)\n    blockText = '\\n\\n~K' + (globals.gHtmlBlocks.push(blockText) - 1) + 'K\\n\\n';\n\n    return blockText;\n  };\n});\n\nshowdown.subParser('hashHTMLBlocks', function (text, options, globals) {\n  'use strict';\n\n  var blockTags = [\n      'pre',\n      'div',\n      'h1',\n      'h2',\n      'h3',\n      'h4',\n      'h5',\n      'h6',\n      'blockquote',\n      'table',\n      'dl',\n      'ol',\n      'ul',\n      'script',\n      'noscript',\n      'form',\n      'fieldset',\n      'iframe',\n      'math',\n      'style',\n      'section',\n      'header',\n      'footer',\n      'nav',\n      'article',\n      'aside',\n      'address',\n      'audio',\n      'canvas',\n      'figure',\n      'hgroup',\n      'output',\n      'video',\n      'p'\n    ],\n    repFunc = function (wholeMatch, match, left, right) {\n      var txt = wholeMatch;\n      // check if this html element is marked as markdown\n      // if so, it's contents should be parsed as markdown\n      if (left.search(/\\bmarkdown\\b/) !== -1) {\n        txt = left + globals.converter.makeHtml(match) + right;\n      }\n      return '\\n\\n~K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\\n\\n';\n    };\n\n  for (var i = 0; i < blockTags.length; ++i) {\n    text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '^(?: |\\\\t){0,3}<' + blockTags[i] + '\\\\b[^>]*>', '</' + blockTags[i] + '>', 'gim');\n  }\n\n  // HR SPECIAL CASE\n  text = text.replace(/(\\n[ ]{0,3}(<(hr)\\b([^<>])*?\\/?>)[ \\t]*(?=\\n{2,}))/g,\n    showdown.subParser('hashElement')(text, options, globals));\n\n  // Special case for standalone HTML comments:\n  text = text.replace(/(<!--[\\s\\S]*?-->)/g,\n    showdown.subParser('hashElement')(text, options, globals));\n\n  // PHP and ASP-style processor instructions (<?...?> and <%...%>)\n  text = text.replace(/(?:\\n\\n)([ ]{0,3}(?:<([?%])[^\\r]*?\\2>)[ \\t]*(?=\\n{2,}))/g,\n    showdown.subParser('hashElement')(text, options, globals));\n  return text;\n});\n\n/**\n * Hash span elements that should not be parsed as markdown\n */\nshowdown.subParser('hashHTMLSpans', function (text, config, globals) {\n  'use strict';\n\n  var matches = showdown.helper.matchRecursiveRegExp(text, '<code\\\\b[^>]*>', '</code>', 'gi');\n\n  for (var i = 0; i < matches.length; ++i) {\n    text = text.replace(matches[i][0], '~L' + (globals.gHtmlSpans.push(matches[i][0]) - 1) + 'L');\n  }\n  return text;\n});\n\n/**\n * Unhash HTML spans\n */\nshowdown.subParser('unhashHTMLSpans', function (text, config, globals) {\n  'use strict';\n\n  for (var i = 0; i < globals.gHtmlSpans.length; ++i) {\n    text = text.replace('~L' + i + 'L', globals.gHtmlSpans[i]);\n  }\n\n  return text;\n});\n\n/**\n * Hash span elements that should not be parsed as markdown\n */\nshowdown.subParser('hashPreCodeTags', function (text, config, globals) {\n  'use strict';\n\n  var repFunc = function (wholeMatch, match, left, right) {\n    // encode html entities\n    var codeblock = left + showdown.subParser('encodeCode')(match) + right;\n    return '\\n\\n~G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\\n\\n';\n  };\n\n  text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '^(?: |\\\\t){0,3}<pre\\\\b[^>]*>\\\\s*<code\\\\b[^>]*>', '^(?: |\\\\t){0,3}</code>\\\\s*</pre>', 'gim');\n  return text;\n});\n\nshowdown.subParser('headers', function (text, options, globals) {\n  'use strict';\n\n  text = globals.converter._dispatch('headers.before', text, options, globals);\n\n  var prefixHeader = options.prefixHeaderId,\n      headerLevelStart = (isNaN(parseInt(options.headerLevelStart))) ? 1 : parseInt(options.headerLevelStart),\n\n  // Set text-style headers:\n  //\tHeader 1\n  //\t========\n  //\n  //\tHeader 2\n  //\t--------\n  //\n      setextRegexH1 = (options.smoothLivePreview) ? /^(.+)[ \\t]*\\n={2,}[ \\t]*\\n+/gm : /^(.+)[ \\t]*\\n=+[ \\t]*\\n+/gm,\n      setextRegexH2 = (options.smoothLivePreview) ? /^(.+)[ \\t]*\\n-{2,}[ \\t]*\\n+/gm : /^(.+)[ \\t]*\\n-+[ \\t]*\\n+/gm;\n\n  text = text.replace(setextRegexH1, function (wholeMatch, m1) {\n\n    var spanGamut = showdown.subParser('spanGamut')(m1, options, globals),\n        hID = (options.noHeaderId) ? '' : ' id=\"' + headerId(m1) + '\"',\n        hLevel = headerLevelStart,\n        hashBlock = '<h' + hLevel + hID + '>' + spanGamut + '</h' + hLevel + '>';\n    return showdown.subParser('hashBlock')(hashBlock, options, globals);\n  });\n\n  text = text.replace(setextRegexH2, function (matchFound, m1) {\n    var spanGamut = showdown.subParser('spanGamut')(m1, options, globals),\n        hID = (options.noHeaderId) ? '' : ' id=\"' + headerId(m1) + '\"',\n        hLevel = headerLevelStart + 1,\n      hashBlock = '<h' + hLevel + hID + '>' + spanGamut + '</h' + hLevel + '>';\n    return showdown.subParser('hashBlock')(hashBlock, options, globals);\n  });\n\n  // atx-style headers:\n  //  # Header 1\n  //  ## Header 2\n  //  ## Header 2 with closing hashes ##\n  //  ...\n  //  ###### Header 6\n  //\n  text = text.replace(/^(#{1,6})[ \\t]*(.+?)[ \\t]*#*\\n+/gm, function (wholeMatch, m1, m2) {\n    var span = showdown.subParser('spanGamut')(m2, options, globals),\n        hID = (options.noHeaderId) ? '' : ' id=\"' + headerId(m2) + '\"',\n        hLevel = headerLevelStart - 1 + m1.length,\n        header = '<h' + hLevel + hID + '>' + span + '</h' + hLevel + '>';\n\n    return showdown.subParser('hashBlock')(header, options, globals);\n  });\n\n  function headerId(m) {\n    var title, escapedId = m.replace(/[^\\w]/g, '').toLowerCase();\n\n    if (globals.hashLinkCounts[escapedId]) {\n      title = escapedId + '-' + (globals.hashLinkCounts[escapedId]++);\n    } else {\n      title = escapedId;\n      globals.hashLinkCounts[escapedId] = 1;\n    }\n\n    // Prefix id to prevent causing inadvertent pre-existing style matches.\n    if (prefixHeader === true) {\n      prefixHeader = 'section';\n    }\n\n    if (showdown.helper.isString(prefixHeader)) {\n      return prefixHeader + title;\n    }\n    return title;\n  }\n\n  text = globals.converter._dispatch('headers.after', text, options, globals);\n  return text;\n});\n\n/**\n * Turn Markdown image shortcuts into <img> tags.\n */\nshowdown.subParser('images', function (text, options, globals) {\n  'use strict';\n\n  text = globals.converter._dispatch('images.before', text, options, globals);\n\n  var inlineRegExp    = /!\\[(.*?)]\\s?\\([ \\t]*()<?(\\S+?)>?(?: =([*\\d]+[A-Za-z%]{0,4})x([*\\d]+[A-Za-z%]{0,4}))?[ \\t]*(?:(['\"])(.*?)\\6[ \\t]*)?\\)/g,\n      referenceRegExp = /!\\[([^\\]]*?)] ?(?:\\n *)?\\[(.*?)]()()()()()/g;\n\n  function writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title) {\n\n    var gUrls   = globals.gUrls,\n        gTitles = globals.gTitles,\n        gDims   = globals.gDimensions;\n\n    linkId = linkId.toLowerCase();\n\n    if (!title) {\n      title = '';\n    }\n\n    if (url === '' || url === null) {\n      if (linkId === '' || linkId === null) {\n        // lower-case and turn embedded newlines into spaces\n        linkId = altText.toLowerCase().replace(/ ?\\n/g, ' ');\n      }\n      url = '#' + linkId;\n\n      if (!showdown.helper.isUndefined(gUrls[linkId])) {\n        url = gUrls[linkId];\n        if (!showdown.helper.isUndefined(gTitles[linkId])) {\n          title = gTitles[linkId];\n        }\n        if (!showdown.helper.isUndefined(gDims[linkId])) {\n          width = gDims[linkId].width;\n          height = gDims[linkId].height;\n        }\n      } else {\n        return wholeMatch;\n      }\n    }\n\n    altText = altText.replace(/\"/g, '&quot;');\n    altText = showdown.helper.escapeCharacters(altText, '*_', false);\n    url = showdown.helper.escapeCharacters(url, '*_', false);\n    var result = '<img src=\"' + url + '\" alt=\"' + altText + '\"';\n\n    if (title) {\n      title = title.replace(/\"/g, '&quot;');\n      title = showdown.helper.escapeCharacters(title, '*_', false);\n      result += ' title=\"' + title + '\"';\n    }\n\n    if (width && height) {\n      width  = (width === '*') ? 'auto' : width;\n      height = (height === '*') ? 'auto' : height;\n\n      result += ' width=\"' + width + '\"';\n      result += ' height=\"' + height + '\"';\n    }\n\n    result += ' />';\n    return result;\n  }\n\n  // First, handle reference-style labeled images: ![alt text][id]\n  text = text.replace(referenceRegExp, writeImageTag);\n\n  // Next, handle inline images:  ![alt text](url =<width>x<height> \"optional title\")\n  text = text.replace(inlineRegExp, writeImageTag);\n\n  text = globals.converter._dispatch('images.after', text, options, globals);\n  return text;\n});\n\nshowdown.subParser('italicsAndBold', function (text, options, globals) {\n  'use strict';\n\n  text = globals.converter._dispatch('italicsAndBold.before', text, options, globals);\n\n  if (options.literalMidWordUnderscores) {\n    //underscores\n    // Since we are consuming a \\s character, we need to add it\n    text = text.replace(/(^|\\s|>|\\b)__(?=\\S)([\\s\\S]+?)__(?=\\b|<|\\s|$)/gm, '$1<strong>$2</strong>');\n    text = text.replace(/(^|\\s|>|\\b)_(?=\\S)([\\s\\S]+?)_(?=\\b|<|\\s|$)/gm, '$1<em>$2</em>');\n    //asterisks\n    text = text.replace(/(\\*\\*)(?=\\S)([^\\r]*?\\S[*]*)\\1/g, '<strong>$2</strong>');\n    text = text.replace(/(\\*)(?=\\S)([^\\r]*?\\S)\\1/g, '<em>$2</em>');\n\n  } else {\n    // <strong> must go first:\n    text = text.replace(/(\\*\\*|__)(?=\\S)([^\\r]*?\\S[*_]*)\\1/g, '<strong>$2</strong>');\n    text = text.replace(/(\\*|_)(?=\\S)([^\\r]*?\\S)\\1/g, '<em>$2</em>');\n  }\n\n  text = globals.converter._dispatch('italicsAndBold.after', text, options, globals);\n  return text;\n});\n\n/**\n * Form HTML ordered (numbered) and unordered (bulleted) lists.\n */\nshowdown.subParser('lists', function (text, options, globals) {\n  'use strict';\n\n  text = globals.converter._dispatch('lists.before', text, options, globals);\n  /**\n   * Process the contents of a single ordered or unordered list, splitting it\n   * into individual list items.\n   * @param {string} listStr\n   * @param {boolean} trimTrailing\n   * @returns {string}\n   */\n  function processListItems (listStr, trimTrailing) {\n    // The $g_list_level global keeps track of when we're inside a list.\n    // Each time we enter a list, we increment it; when we leave a list,\n    // we decrement. If it's zero, we're not in a list anymore.\n    //\n    // We do this because when we're not inside a list, we want to treat\n    // something like this:\n    //\n    //    I recommend upgrading to version\n    //    8. Oops, now this line is treated\n    //    as a sub-list.\n    //\n    // As a single paragraph, despite the fact that the second line starts\n    // with a digit-period-space sequence.\n    //\n    // Whereas when we're inside a list (or sub-list), that line will be\n    // treated as the start of a sub-list. What a kludge, huh? This is\n    // an aspect of Markdown's syntax that's hard to parse perfectly\n    // without resorting to mind-reading. Perhaps the solution is to\n    // change the syntax rules such that sub-lists must start with a\n    // starting cardinal number; e.g. \"1.\" or \"a.\".\n    globals.gListLevel++;\n\n    // trim trailing blank lines:\n    listStr = listStr.replace(/\\n{2,}$/, '\\n');\n\n    // attacklab: add sentinel to emulate \\z\n    listStr += '~0';\n\n    var rgx = /(\\n)?(^[ \\t]*)([*+-]|\\d+[.])[ \\t]+((\\[(x|X| )?])?[ \\t]*[^\\r]+?(\\n{1,2}))(?=\\n*(~0|\\2([*+-]|\\d+[.])[ \\t]+))/gm,\n        isParagraphed = (/\\n[ \\t]*\\n(?!~0)/.test(listStr));\n\n    listStr = listStr.replace(rgx, function (wholeMatch, m1, m2, m3, m4, taskbtn, checked) {\n      checked = (checked && checked.trim() !== '');\n      var item = showdown.subParser('outdent')(m4, options, globals),\n          bulletStyle = '';\n\n      // Support for github tasklists\n      if (taskbtn && options.tasklists) {\n        bulletStyle = ' class=\"task-list-item\" style=\"list-style-type: none;\"';\n        item = item.replace(/^[ \\t]*\\[(x|X| )?]/m, function () {\n          var otp = '<input type=\"checkbox\" disabled style=\"margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;\"';\n          if (checked) {\n            otp += ' checked';\n          }\n          otp += '>';\n          return otp;\n        });\n      }\n      // m1 - Leading line or\n      // Has a double return (multi paragraph) or\n      // Has sublist\n      if (m1 || (item.search(/\\n{2,}/) > -1)) {\n        item = showdown.subParser('githubCodeBlocks')(item, options, globals);\n        item = showdown.subParser('blockGamut')(item, options, globals);\n      } else {\n        // Recursion for sub-lists:\n        item = showdown.subParser('lists')(item, options, globals);\n        item = item.replace(/\\n$/, ''); // chomp(item)\n        if (isParagraphed) {\n          item = showdown.subParser('paragraphs')(item, options, globals);\n        } else {\n          item = showdown.subParser('spanGamut')(item, options, globals);\n        }\n      }\n      item =  '\\n<li' + bulletStyle + '>' + item + '</li>\\n';\n      return item;\n    });\n\n    // attacklab: strip sentinel\n    listStr = listStr.replace(/~0/g, '');\n\n    globals.gListLevel--;\n\n    if (trimTrailing) {\n      listStr = listStr.replace(/\\s+$/, '');\n    }\n\n    return listStr;\n  }\n\n  /**\n   * Check and parse consecutive lists (better fix for issue #142)\n   * @param {string} list\n   * @param {string} listType\n   * @param {boolean} trimTrailing\n   * @returns {string}\n   */\n  function parseConsecutiveLists(list, listType, trimTrailing) {\n    // check if we caught 2 or more consecutive lists by mistake\n    // we use the counterRgx, meaning if listType is UL we look for UL and vice versa\n    var counterRxg = (listType === 'ul') ? /^ {0,2}\\d+\\.[ \\t]/gm : /^ {0,2}[*+-][ \\t]/gm,\n      subLists = [],\n      result = '';\n\n    if (list.search(counterRxg) !== -1) {\n      (function parseCL(txt) {\n        var pos = txt.search(counterRxg);\n        if (pos !== -1) {\n          // slice\n          result += '\\n\\n<' + listType + '>' + processListItems(txt.slice(0, pos), !!trimTrailing) + '</' + listType + '>\\n\\n';\n\n          // invert counterType and listType\n          listType = (listType === 'ul') ? 'ol' : 'ul';\n          counterRxg = (listType === 'ul') ? /^ {0,2}\\d+\\.[ \\t]/gm : /^ {0,2}[*+-][ \\t]/gm;\n\n          //recurse\n          parseCL(txt.slice(pos));\n        } else {\n          result += '\\n\\n<' + listType + '>' + processListItems(txt, !!trimTrailing) + '</' + listType + '>\\n\\n';\n        }\n      })(list);\n      for (var i = 0; i < subLists.length; ++i) {\n\n      }\n    } else {\n      result = '\\n\\n<' + listType + '>' + processListItems(list, !!trimTrailing) + '</' + listType + '>\\n\\n';\n    }\n\n    return result;\n  }\n\n  // attacklab: add sentinel to hack around khtml/safari bug:\n  // http://bugs.webkit.org/show_bug.cgi?id=11231\n  text += '~0';\n\n  // Re-usable pattern to match any entire ul or ol list:\n  var wholeList = /^(([ ]{0,3}([*+-]|\\d+[.])[ \\t]+)[^\\r]+?(~0|\\n{2,}(?=\\S)(?![ \\t]*(?:[*+-]|\\d+[.])[ \\t]+)))/gm;\n\n  if (globals.gListLevel) {\n    text = text.replace(wholeList, function (wholeMatch, list, m2) {\n      var listType = (m2.search(/[*+-]/g) > -1) ? 'ul' : 'ol';\n      return parseConsecutiveLists(list, listType, true);\n    });\n  } else {\n    wholeList = /(\\n\\n|^\\n?)(([ ]{0,3}([*+-]|\\d+[.])[ \\t]+)[^\\r]+?(~0|\\n{2,}(?=\\S)(?![ \\t]*(?:[*+-]|\\d+[.])[ \\t]+)))/gm;\n    //wholeList = /(\\n\\n|^\\n?)( {0,3}([*+-]|\\d+\\.)[ \\t]+[\\s\\S]+?)(?=(~0)|(\\n\\n(?!\\t| {2,}| {0,3}([*+-]|\\d+\\.)[ \\t])))/g;\n    text = text.replace(wholeList, function (wholeMatch, m1, list, m3) {\n\n      var listType = (m3.search(/[*+-]/g) > -1) ? 'ul' : 'ol';\n      return parseConsecutiveLists(list, listType);\n    });\n  }\n\n  // attacklab: strip sentinel\n  text = text.replace(/~0/, '');\n\n  text = globals.converter._dispatch('lists.after', text, options, globals);\n  return text;\n});\n\n/**\n * Remove one level of line-leading tabs or spaces\n */\nshowdown.subParser('outdent', function (text) {\n  'use strict';\n\n  // attacklab: hack around Konqueror 3.5.4 bug:\n  // \"----------bug\".replace(/^-/g,\"\") == \"bug\"\n  text = text.replace(/^(\\t|[ ]{1,4})/gm, '~0'); // attacklab: g_tab_width\n\n  // attacklab: clean up hack\n  text = text.replace(/~0/g, '');\n\n  return text;\n});\n\n/**\n *\n */\nshowdown.subParser('paragraphs', function (text, options, globals) {\n  'use strict';\n\n  text = globals.converter._dispatch('paragraphs.before', text, options, globals);\n  // Strip leading and trailing lines:\n  text = text.replace(/^\\n+/g, '');\n  text = text.replace(/\\n+$/g, '');\n\n  var grafs = text.split(/\\n{2,}/g),\n      grafsOut = [],\n      end = grafs.length; // Wrap <p> tags\n\n  for (var i = 0; i < end; i++) {\n    var str = grafs[i];\n    // if this is an HTML marker, copy it\n    if (str.search(/~(K|G)(\\d+)\\1/g) >= 0) {\n      grafsOut.push(str);\n    } else {\n      str = showdown.subParser('spanGamut')(str, options, globals);\n      str = str.replace(/^([ \\t]*)/g, '<p>');\n      str += '</p>';\n      grafsOut.push(str);\n    }\n  }\n\n  /** Unhashify HTML blocks */\n  end = grafsOut.length;\n  for (i = 0; i < end; i++) {\n    var blockText = '',\n        grafsOutIt = grafsOut[i],\n        codeFlag = false;\n    // if this is a marker for an html block...\n    while (grafsOutIt.search(/~(K|G)(\\d+)\\1/) >= 0) {\n      var delim = RegExp.$1,\n          num   = RegExp.$2;\n\n      if (delim === 'K') {\n        blockText = globals.gHtmlBlocks[num];\n      } else {\n        // we need to check if ghBlock is a false positive\n        if (codeFlag) {\n          // use encoded version of all text\n          blockText = showdown.subParser('encodeCode')(globals.ghCodeBlocks[num].text);\n        } else {\n          blockText = globals.ghCodeBlocks[num].codeblock;\n        }\n      }\n      blockText = blockText.replace(/\\$/g, '$$$$'); // Escape any dollar signs\n\n      grafsOutIt = grafsOutIt.replace(/(\\n\\n)?~(K|G)\\d+\\2(\\n\\n)?/, blockText);\n      // Check if grafsOutIt is a pre->code\n      if (/^<pre\\b[^>]*>\\s*<code\\b[^>]*>/.test(grafsOutIt)) {\n        codeFlag = true;\n      }\n    }\n    grafsOut[i] = grafsOutIt;\n  }\n  text = grafsOut.join('\\n\\n');\n  // Strip leading and trailing lines:\n  text = text.replace(/^\\n+/g, '');\n  text = text.replace(/\\n+$/g, '');\n  return globals.converter._dispatch('paragraphs.after', text, options, globals);\n});\n\n/**\n * Run extension\n */\nshowdown.subParser('runExtension', function (ext, text, options, globals) {\n  'use strict';\n\n  if (ext.filter) {\n    text = ext.filter(text, globals.converter, options);\n\n  } else if (ext.regex) {\n    // TODO remove this when old extension loading mechanism is deprecated\n    var re = ext.regex;\n    if (!re instanceof RegExp) {\n      re = new RegExp(re, 'g');\n    }\n    text = text.replace(re, ext.replace);\n  }\n\n  return text;\n});\n\n/**\n * These are all the transformations that occur *within* block-level\n * tags like paragraphs, headers, and list items.\n */\nshowdown.subParser('spanGamut', function (text, options, globals) {\n  'use strict';\n\n  text = globals.converter._dispatch('spanGamut.before', text, options, globals);\n  text = showdown.subParser('codeSpans')(text, options, globals);\n  text = showdown.subParser('escapeSpecialCharsWithinTagAttributes')(text, options, globals);\n  text = showdown.subParser('encodeBackslashEscapes')(text, options, globals);\n\n  // Process anchor and image tags. Images must come first,\n  // because ![foo][f] looks like an anchor.\n  text = showdown.subParser('images')(text, options, globals);\n  text = showdown.subParser('anchors')(text, options, globals);\n\n  // Make links out of things like `<http://example.com/>`\n  // Must come after _DoAnchors(), because you can use < and >\n  // delimiters in inline links like [this](<url>).\n  text = showdown.subParser('autoLinks')(text, options, globals);\n  text = showdown.subParser('encodeAmpsAndAngles')(text, options, globals);\n  text = showdown.subParser('italicsAndBold')(text, options, globals);\n  text = showdown.subParser('strikethrough')(text, options, globals);\n\n  // Do hard breaks:\n  text = text.replace(/  +\\n/g, ' <br />\\n');\n\n  text = globals.converter._dispatch('spanGamut.after', text, options, globals);\n  return text;\n});\n\nshowdown.subParser('strikethrough', function (text, options, globals) {\n  'use strict';\n\n  if (options.strikethrough) {\n    text = globals.converter._dispatch('strikethrough.before', text, options, globals);\n    text = text.replace(/(?:~T){2}([\\s\\S]+?)(?:~T){2}/g, '<del>$1</del>');\n    text = globals.converter._dispatch('strikethrough.after', text, options, globals);\n  }\n\n  return text;\n});\n\n/**\n * Strip any lines consisting only of spaces and tabs.\n * This makes subsequent regexs easier to write, because we can\n * match consecutive blank lines with /\\n+/ instead of something\n * contorted like /[ \\t]*\\n+/\n */\nshowdown.subParser('stripBlankLines', function (text) {\n  'use strict';\n  return text.replace(/^[ \\t]+$/mg, '');\n});\n\n/**\n * Strips link definitions from text, stores the URLs and titles in\n * hash references.\n * Link defs are in the form: ^[id]: url \"optional title\"\n *\n * ^[ ]{0,3}\\[(.+)\\]: // id = $1  attacklab: g_tab_width - 1\n * [ \\t]*\n * \\n?                  // maybe *one* newline\n * [ \\t]*\n * <?(\\S+?)>?          // url = $2\n * [ \\t]*\n * \\n?                // maybe one newline\n * [ \\t]*\n * (?:\n * (\\n*)              // any lines skipped = $3 attacklab: lookbehind removed\n * [\"(]\n * (.+?)              // title = $4\n * [\")]\n * [ \\t]*\n * )?                 // title is optional\n * (?:\\n+|$)\n * /gm,\n * function(){...});\n *\n */\nshowdown.subParser('stripLinkDefinitions', function (text, options, globals) {\n  'use strict';\n\n  var regex = /^ {0,3}\\[(.+)]:[ \\t]*\\n?[ \\t]*<?(\\S+?)>?(?: =([*\\d]+[A-Za-z%]{0,4})x([*\\d]+[A-Za-z%]{0,4}))?[ \\t]*\\n?[ \\t]*(?:(\\n*)[\"|'(](.+?)[\"|')][ \\t]*)?(?:\\n+|(?=~0))/gm;\n\n  // attacklab: sentinel workarounds for lack of \\A and \\Z, safari\\khtml bug\n  text += '~0';\n\n  text = text.replace(regex, function (wholeMatch, linkId, url, width, height, blankLines, title) {\n    linkId = linkId.toLowerCase();\n    globals.gUrls[linkId] = showdown.subParser('encodeAmpsAndAngles')(url);  // Link IDs are case-insensitive\n\n    if (blankLines) {\n      // Oops, found blank lines, so it's not a title.\n      // Put back the parenthetical statement we stole.\n      return blankLines + title;\n\n    } else {\n      if (title) {\n        globals.gTitles[linkId] = title.replace(/\"|'/g, '&quot;');\n      }\n      if (options.parseImgDimensions && width && height) {\n        globals.gDimensions[linkId] = {\n          width:  width,\n          height: height\n        };\n      }\n    }\n    // Completely remove the definition from the text\n    return '';\n  });\n\n  // attacklab: strip sentinel\n  text = text.replace(/~0/, '');\n\n  return text;\n});\n\nshowdown.subParser('tables', function (text, options, globals) {\n  'use strict';\n\n  if (!options.tables) {\n    return text;\n  }\n\n  var tableRgx = /^[ \\t]{0,3}\\|?.+\\|.+\\n[ \\t]{0,3}\\|?[ \\t]*:?[ \\t]*(?:-|=){2,}[ \\t]*:?[ \\t]*\\|[ \\t]*:?[ \\t]*(?:-|=){2,}[\\s\\S]+?(?:\\n\\n|~0)/gm;\n\n  function parseStyles(sLine) {\n    if (/^:[ \\t]*--*$/.test(sLine)) {\n      return ' style=\"text-align:left;\"';\n    } else if (/^--*[ \\t]*:[ \\t]*$/.test(sLine)) {\n      return ' style=\"text-align:right;\"';\n    } else if (/^:[ \\t]*--*[ \\t]*:$/.test(sLine)) {\n      return ' style=\"text-align:center;\"';\n    } else {\n      return '';\n    }\n  }\n\n  function parseHeaders(header, style) {\n    var id = '';\n    header = header.trim();\n    if (options.tableHeaderId) {\n      id = ' id=\"' + header.replace(/ /g, '_').toLowerCase() + '\"';\n    }\n    header = showdown.subParser('spanGamut')(header, options, globals);\n\n    return '<th' + id + style + '>' + header + '</th>\\n';\n  }\n\n  function parseCells(cell, style) {\n    var subText = showdown.subParser('spanGamut')(cell, options, globals);\n    return '<td' + style + '>' + subText + '</td>\\n';\n  }\n\n  function buildTable(headers, cells) {\n    var tb = '<table>\\n<thead>\\n<tr>\\n',\n        tblLgn = headers.length;\n\n    for (var i = 0; i < tblLgn; ++i) {\n      tb += headers[i];\n    }\n    tb += '</tr>\\n</thead>\\n<tbody>\\n';\n\n    for (i = 0; i < cells.length; ++i) {\n      tb += '<tr>\\n';\n      for (var ii = 0; ii < tblLgn; ++ii) {\n        tb += cells[i][ii];\n      }\n      tb += '</tr>\\n';\n    }\n    tb += '</tbody>\\n</table>\\n';\n    return tb;\n  }\n\n  text = globals.converter._dispatch('tables.before', text, options, globals);\n\n  text = text.replace(tableRgx, function (rawTable) {\n\n    var i, tableLines = rawTable.split('\\n');\n\n    // strip wrong first and last column if wrapped tables are used\n    for (i = 0; i < tableLines.length; ++i) {\n      if (/^[ \\t]{0,3}\\|/.test(tableLines[i])) {\n        tableLines[i] = tableLines[i].replace(/^[ \\t]{0,3}\\|/, '');\n      }\n      if (/\\|[ \\t]*$/.test(tableLines[i])) {\n        tableLines[i] = tableLines[i].replace(/\\|[ \\t]*$/, '');\n      }\n    }\n\n    var rawHeaders = tableLines[0].split('|').map(function (s) { return s.trim();}),\n        rawStyles = tableLines[1].split('|').map(function (s) { return s.trim();}),\n        rawCells = [],\n        headers = [],\n        styles = [],\n        cells = [];\n\n    tableLines.shift();\n    tableLines.shift();\n\n    for (i = 0; i < tableLines.length; ++i) {\n      if (tableLines[i].trim() === '') {\n        continue;\n      }\n      rawCells.push(\n        tableLines[i]\n          .split('|')\n          .map(function (s) {\n            return s.trim();\n          })\n      );\n    }\n\n    if (rawHeaders.length < rawStyles.length) {\n      return rawTable;\n    }\n\n    for (i = 0; i < rawStyles.length; ++i) {\n      styles.push(parseStyles(rawStyles[i]));\n    }\n\n    for (i = 0; i < rawHeaders.length; ++i) {\n      if (showdown.helper.isUndefined(styles[i])) {\n        styles[i] = '';\n      }\n      headers.push(parseHeaders(rawHeaders[i], styles[i]));\n    }\n\n    for (i = 0; i < rawCells.length; ++i) {\n      var row = [];\n      for (var ii = 0; ii < headers.length; ++ii) {\n        if (showdown.helper.isUndefined(rawCells[i][ii])) {\n\n        }\n        row.push(parseCells(rawCells[i][ii], styles[ii]));\n      }\n      cells.push(row);\n    }\n\n    return buildTable(headers, cells);\n  });\n\n  text = globals.converter._dispatch('tables.after', text, options, globals);\n\n  return text;\n});\n\n/**\n * Swap back in all the special characters we've hidden.\n */\nshowdown.subParser('unescapeSpecialChars', function (text) {\n  'use strict';\n\n  text = text.replace(/~E(\\d+)E/g, function (wholeMatch, m1) {\n    var charCodeToReplace = parseInt(m1);\n    return String.fromCharCode(charCodeToReplace);\n  });\n  return text;\n});\nmodule.exports = showdown;\n"
  },
  {
    "path": "lib/wxParse/wxDiscode.js",
    "content": "// HTML 支持的数学符号\nfunction strNumDiscode(str){\n    str = str.replace(/&forall;/g, '∀');\n    str = str.replace(/&part;/g, '∂');\n    str = str.replace(/&exists;/g, '∃');\n    str = str.replace(/&empty;/g, '∅');\n    str = str.replace(/&nabla;/g, '∇');\n    str = str.replace(/&isin;/g, '∈');\n    str = str.replace(/&notin;/g, '∉');\n    str = str.replace(/&ni;/g, '∋');\n    str = str.replace(/&prod;/g, '∏');\n    str = str.replace(/&sum;/g, '∑');\n    str = str.replace(/&minus;/g, '−');\n    str = str.replace(/&lowast;/g, '∗');\n    str = str.replace(/&radic;/g, '√');\n    str = str.replace(/&prop;/g, '∝');\n    str = str.replace(/&infin;/g, '∞');\n    str = str.replace(/&ang;/g, '∠');\n    str = str.replace(/&and;/g, '∧');\n    str = str.replace(/&or;/g, '∨');\n    str = str.replace(/&cap;/g, '∩');\n    str = str.replace(/&cap;/g, '∪');\n    str = str.replace(/&int;/g, '∫');\n    str = str.replace(/&there4;/g, '∴');\n    str = str.replace(/&sim;/g, '∼');\n    str = str.replace(/&cong;/g, '≅');\n    str = str.replace(/&asymp;/g, '≈');\n    str = str.replace(/&ne;/g, '≠');\n    str = str.replace(/&le;/g, '≤');\n    str = str.replace(/&ge;/g, '≥');\n    str = str.replace(/&sub;/g, '⊂');\n    str = str.replace(/&sup;/g, '⊃');\n    str = str.replace(/&nsub;/g, '⊄');\n    str = str.replace(/&sube;/g, '⊆');\n    str = str.replace(/&supe;/g, '⊇');\n    str = str.replace(/&oplus;/g, '⊕');\n    str = str.replace(/&otimes;/g, '⊗');\n    str = str.replace(/&perp;/g, '⊥');\n    str = str.replace(/&sdot;/g, '⋅');\n    return str;\n}\n\n//HTML 支持的希腊字母\nfunction strGreeceDiscode(str){\n    str = str.replace(/&Alpha;/g, 'Α');\n    str = str.replace(/&Beta;/g, 'Β');\n    str = str.replace(/&Gamma;/g, 'Γ');\n    str = str.replace(/&Delta;/g, 'Δ');\n    str = str.replace(/&Epsilon;/g, 'Ε');\n    str = str.replace(/&Zeta;/g, 'Ζ');\n    str = str.replace(/&Eta;/g, 'Η');\n    str = str.replace(/&Theta;/g, 'Θ');\n    str = str.replace(/&Iota;/g, 'Ι');\n    str = str.replace(/&Kappa;/g, 'Κ');\n    str = str.replace(/&Lambda;/g, 'Λ');\n    str = str.replace(/&Mu;/g, 'Μ');\n    str = str.replace(/&Nu;/g, 'Ν');\n    str = str.replace(/&Xi;/g, 'Ν');\n    str = str.replace(/&Omicron;/g, 'Ο');\n    str = str.replace(/&Pi;/g, 'Π');\n    str = str.replace(/&Rho;/g, 'Ρ');\n    str = str.replace(/&Sigma;/g, 'Σ');\n    str = str.replace(/&Tau;/g, 'Τ');\n    str = str.replace(/&Upsilon;/g, 'Υ');\n    str = str.replace(/&Phi;/g, 'Φ');\n    str = str.replace(/&Chi;/g, 'Χ');\n    str = str.replace(/&Psi;/g, 'Ψ');\n    str = str.replace(/&Omega;/g, 'Ω');\n\n    str = str.replace(/&alpha;/g, 'α');\n    str = str.replace(/&beta;/g, 'β');\n    str = str.replace(/&gamma;/g, 'γ');\n    str = str.replace(/&delta;/g, 'δ');\n    str = str.replace(/&epsilon;/g, 'ε');\n    str = str.replace(/&zeta;/g, 'ζ');\n    str = str.replace(/&eta;/g, 'η');\n    str = str.replace(/&theta;/g, 'θ');\n    str = str.replace(/&iota;/g, 'ι');\n    str = str.replace(/&kappa;/g, 'κ');\n    str = str.replace(/&lambda;/g, 'λ');\n    str = str.replace(/&mu;/g, 'μ');\n    str = str.replace(/&nu;/g, 'ν');\n    str = str.replace(/&xi;/g, 'ξ');\n    str = str.replace(/&omicron;/g, 'ο');\n    str = str.replace(/&pi;/g, 'π');\n    str = str.replace(/&rho;/g, 'ρ');\n    str = str.replace(/&sigmaf;/g, 'ς');\n    str = str.replace(/&sigma;/g, 'σ');\n    str = str.replace(/&tau;/g, 'τ');\n    str = str.replace(/&upsilon;/g, 'υ');\n    str = str.replace(/&phi;/g, 'φ');\n    str = str.replace(/&chi;/g, 'χ');\n    str = str.replace(/&psi;/g, 'ψ');\n    str = str.replace(/&omega;/g, 'ω');\n    str = str.replace(/&thetasym;/g, 'ϑ');\n    str = str.replace(/&upsih;/g, 'ϒ');\n    str = str.replace(/&piv;/g, 'ϖ');\n    str = str.replace(/&middot;/g, '·');\n    return str;\n}\n\n// \n\nfunction strcharacterDiscode(str){\n    // 加入常用解析\n    str = str.replace(/&nbsp;/g, ' ');\n    str = str.replace(/&quot;/g, '\"');\n    str = str.replace(/&amp;/g, '&');\n    // str = str.replace(/&lt;/g, '‹');\n    // str = str.replace(/&gt;/g, '›');\n\n    str = str.replace(/&lt;/g, '<');\n    str = str.replace(/&gt;/g, '>');\n\n    return str;\n}\n\n// HTML 支持的其他实体\nfunction strOtherDiscode(str){\n    str = str.replace(/&OElig;/g, 'Œ');\n    str = str.replace(/&oelig;/g, 'œ');\n    str = str.replace(/&Scaron;/g, 'Š');\n    str = str.replace(/&scaron;/g, 'š');\n    str = str.replace(/&Yuml;/g, 'Ÿ');\n    str = str.replace(/&fnof;/g, 'ƒ');\n    str = str.replace(/&circ;/g, 'ˆ');\n    str = str.replace(/&tilde;/g, '˜');\n    str = str.replace(/&ensp;/g, '');\n    str = str.replace(/&emsp;/g, '');\n    str = str.replace(/&thinsp;/g, '');\n    str = str.replace(/&zwnj;/g, '');\n    str = str.replace(/&zwj;/g, '');\n    str = str.replace(/&lrm;/g, '');\n    str = str.replace(/&rlm;/g, '');\n    str = str.replace(/&ndash;/g, '–');\n    str = str.replace(/&mdash;/g, '—');\n    str = str.replace(/&lsquo;/g, '‘');\n    str = str.replace(/&rsquo;/g, '’');\n    str = str.replace(/&sbquo;/g, '‚');\n    str = str.replace(/&ldquo;/g, '“');\n    str = str.replace(/&rdquo;/g, '”');\n    str = str.replace(/&bdquo;/g, '„');\n    str = str.replace(/&dagger;/g, '†');\n    str = str.replace(/&Dagger;/g, '‡');\n    str = str.replace(/&bull;/g, '•');\n    str = str.replace(/&hellip;/g, '…');\n    str = str.replace(/&permil;/g, '‰');\n    str = str.replace(/&prime;/g, '′');\n    str = str.replace(/&Prime;/g, '″');\n    str = str.replace(/&lsaquo;/g, '‹');\n    str = str.replace(/&rsaquo;/g, '›');\n    str = str.replace(/&oline;/g, '‾');\n    str = str.replace(/&euro;/g, '€');\n    str = str.replace(/&trade;/g, '™');\n\n    str = str.replace(/&larr;/g, '←');\n    str = str.replace(/&uarr;/g, '↑');\n    str = str.replace(/&rarr;/g, '→');\n    str = str.replace(/&darr;/g, '↓');\n    str = str.replace(/&harr;/g, '↔');\n    str = str.replace(/&crarr;/g, '↵');\n    str = str.replace(/&lceil;/g, '⌈');\n    str = str.replace(/&rceil;/g, '⌉');\n\n    str = str.replace(/&lfloor;/g, '⌊');\n    str = str.replace(/&rfloor;/g, '⌋');\n    str = str.replace(/&loz;/g, '◊');\n    str = str.replace(/&spades;/g, '♠');\n    str = str.replace(/&clubs;/g, '♣');\n    str = str.replace(/&hearts;/g, '♥');\n\n    str = str.replace(/&diams;/g, '♦');\n\n    return str;\n}\n\nfunction strMoreDiscode(str){\n    str = str.replace(/\\r\\n/g,\"\");  \n    str = str.replace(/\\n/g,\"\");\n\n    str = str.replace(/code/g,\"wxxxcode-style\");\n    return str;\n}\n\nfunction strDiscode(str){\n    str = strNumDiscode(str);\n    str = strGreeceDiscode(str);\n    str = strcharacterDiscode(str);\n    str = strOtherDiscode(str);\n    str = strMoreDiscode(str);\n    return str;\n}\nfunction urlToHttpUrl(url,rep){\n    \n    var patt1 = new RegExp(\"^//\");\n    var result = patt1.test(url);\n    if(result){\n        url = rep+\":\"+url;\n    }\n    return  url;\n}\n\nmodule.exports = {\n    strDiscode:strDiscode,\n    urlToHttpUrl:urlToHttpUrl\n}"
  },
  {
    "path": "lib/wxParse/wxParse.js",
    "content": "/**\n * author: Di (微信小程序开发工程师)\n * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)\n *               垂直微信小程序开发交流社区\n * \n * github地址: https://github.com/icindy/wxParse\n * \n * for: 微信小程序富文本解析\n * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184\n */\n\n/**\n * utils函数引入\n **/\nimport showdown from 'showdown.js';\nimport HtmlToJson from 'html2json.js';\n/**\n * 配置及公有属性\n **/\n/**\n * 主函数入口区\n **/\nfunction wxParse(bindName = 'wxParseData', type='html', data='<div class=\"color:red;\">数据不能为空</div>', target,imagePadding) {\n  var that = target;\n  var transData = {};//存放转化后的数据\n  if (type == 'html') {\n    transData = HtmlToJson.html2json(data, bindName);\n    console.log(JSON.stringify(transData, ' ', ' '));\n  } else if (type == 'md' || type == 'markdown') {\n    var converter = new showdown.Converter();\n    var html = converter.makeHtml(data);\n    transData = HtmlToJson.html2json(html, bindName);\n    console.log(JSON.stringify(transData, ' ', ' '));\n  }\n  transData.view = {};\n  transData.view.imagePadding = 0;\n  if(typeof(imagePadding) != 'undefined'){\n    transData.view.imagePadding = imagePadding\n  }\n  var bindData = {};\n  bindData[bindName] = transData;\n  that.setData(bindData)\n  that.wxParseImgLoad = wxParseImgLoad;\n  that.wxParseImgTap = wxParseImgTap;\n}\n// 图片点击事件\nfunction wxParseImgTap(e) {\n  var that = this;\n  var nowImgUrl = e.target.dataset.src;\n  var tagFrom = e.target.dataset.from;\n  if (typeof (tagFrom) != 'undefined' && tagFrom.length > 0) {\n    wx.previewImage({\n      current: nowImgUrl, // 当前显示图片的http链接\n      urls: that.data[tagFrom].imageUrls // 需要预览的图片http链接列表\n    })\n  }\n}\n\n/**\n * 图片视觉宽高计算函数区 \n **/\nfunction wxParseImgLoad(e) {\n  var that = this;\n  var tagFrom = e.target.dataset.from;\n  var idx = e.target.dataset.idx;\n  if (typeof (tagFrom) != 'undefined' && tagFrom.length > 0) {\n    calMoreImageInfo(e, idx, that, tagFrom)\n  } \n}\n// 假循环获取计算图片视觉最佳宽高\nfunction calMoreImageInfo(e, idx, that, bindName) {\n  var temData = that.data[bindName];\n  if (temData.images.length == 0) {\n    return;\n  }\n  var temImages = temData.images;\n  //因为无法获取view宽度 需要自定义padding进行计算，稍后处理\n  var recal = wxAutoImageCal(e.detail.width, e.detail.height,that,bindName); \n  temImages[idx].width = recal.imageWidth;\n  temImages[idx].height = recal.imageheight; \n  temData.images = temImages;\n  var bindData = {};\n  bindData[bindName] = temData;\n  that.setData(bindData);\n}\n\n// 计算视觉优先的图片宽高\nfunction wxAutoImageCal(originalWidth, originalHeight,that,bindName) {\n  //获取图片的原始长宽\n  var windowWidth = 0, windowHeight = 0;\n  var autoWidth = 0, autoHeight = 0;\n  var results = {};\n  wx.getSystemInfo({\n    success: function (res) {\n      var padding = that.data[bindName].view.imagePadding;\n      windowWidth = res.windowWidth-2*padding;\n      windowHeight = res.windowHeight;\n      //判断按照那种方式进行缩放\n      console.log(\"windowWidth\" + windowWidth);\n      if (originalWidth > windowWidth) {//在图片width大于手机屏幕width时候\n        autoWidth = windowWidth;\n        console.log(\"autoWidth\" + autoWidth);\n        autoHeight = (autoWidth * originalHeight) / originalWidth;\n        console.log(\"autoHeight\" + autoHeight);\n        results.imageWidth = autoWidth;\n        results.imageheight = autoHeight;\n      } else {//否则展示原来的数据\n        results.imageWidth = originalWidth;\n        results.imageheight = originalHeight;\n      }\n    }\n  })\n  return results;\n}\n\nfunction wxParseTemArray(temArrayName,bindNameReg,total,that){\n  var array = [];\n  var temData = that.data;\n  var obj = null;\n  for(var i = 0; i < total; i++){\n    var simArr = temData[bindNameReg+i].nodes;\n    array.push(simArr);\n  }\n\n  temArrayName = temArrayName || 'wxParseTemArray';\n  obj = JSON.parse('{\"'+ temArrayName +'\":\"\"}');\n  obj[temArrayName] = array;\n  that.setData(obj);\n}\n\n/**\n * 配置emojis\n * \n */\n\nfunction emojisInit(reg='',baseSrc=\"/wxParse/emojis/\",emojis){\n   HtmlToJson.emojisInit(reg,baseSrc,emojis);\n}\n\nmodule.exports = {\n  wxParse: wxParse,\n  wxParseTemArray:wxParseTemArray,\n  emojisInit:emojisInit\n}\n\n\n"
  },
  {
    "path": "lib/wxParse/wxParse.wxml",
    "content": "\n<!--**\n * author: Di (微信小程序开发工程师)\n * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)\n *               垂直微信小程序开发交流社区\n * \n * github地址: https://github.com/icindy/wxParse\n * \n * for: 微信小程序富文本解析\n * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184\n */-->\n\n <!--基础元素-->\n<template name=\"wxParseVideo\">\n    <!--增加video标签支持，并循环添加-->\n    <view class=\"{{item.classStr}} wxParse-{{item.tag}}\" style=\"{{item.styleStr}}\">\n        <video class=\"{{item.classStr}} wxParse-{{item.tag}}-video\" src=\"{{item.attr.src}}\"></video>\n    </view>\n</template>\n\n<template name=\"wxParseImg\">\n    <image class=\"{{item.classStr}} wxParse-{{item.tag}}\" data-from=\"{{item.from}}\" data-src=\"{{item.attr.src}}\"  data-idx=\"{{item.imgIndex}}\"  src=\"{{item.attr.src}}\" mode=\"aspectFit\" bindload=\"wxParseImgLoad\" bindtap=\"wxParseImgTap\" style=\"width:{{item.width}}px;height:{{item.height}}px;{{item.attr.style}}\"   />\n</template>\n\n<template name=\"WxEmojiView\">\n  <view class=\"WxEmojiView wxParse-inline\" style=\"{{item.styleStr}}\">\n    <block wx:for=\"{{item.textArray}}\" wx:key=\"\">\n      <block class=\"{{item.text == '\\\\n' ? 'wxParse-hide':''}}\" wx:if=\"{{item.node == 'text'}}\">{{item.text}}</block>\n      <block wx:elif=\"{{item.node == 'element'}}\">\n        <image class=\"wxEmoji\" src=\"{{item.baseSrc}}{{item.text}}\" />\n      </block>\n    </block>\n  </view>\n</template>\n\n<!--入口模版-->\n\n<template name=\"wxParse\">\n    <block wx:for=\"{{wxParseData}}\" wx:key=\"\">\n        <template is=\"wxParse0\" data=\"{{item}}\"/>\n    </block>\n</template>\n\n\n<!--循环模版-->\n<template name=\"wxParse0\">\n    <!--<template is=\"wxParse1\" data=\"{{item}}\" />-->\n    <!--判断是否是标签节点-->\n    <block wx:if=\"{{item.node == 'element'}}\">\n        <block wx:if=\"{{item.tag == 'button'}}\">\n            <button type=\"default\" size=\"mini\" >\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse1\" data=\"{{item}}\"/>\n                </block>\n             </button>\n        </block>\n        <!--li类型-->\n        <block wx:elif=\"{{item.tag == 'li'}}\">\n            <view class=\"{{item.classStr}} wxParse-li\">\n                <view class=\"{{item.classStr}} wxParse-li-inner\">\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <view class=\"{{item.classStr}} wxParse-li-circle\"></view>\n                    </view>\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                            <template is=\"wxParse1\" data=\"{{item}}\"/>\n                        </block>\n                    </view>\n                </view>\n            </view>\n        </block>\n\n        <!--video类型-->\n        <block wx:elif=\"{{item.tag == 'video'}}\">\n            <template is=\"wxParseVideo\" data=\"{{item}}\"/>  \n        </block>\n\n        <!--img类型-->\n        <block wx:elif=\"{{item.tag == 'img'}}\">\n            <template is=\"wxParseImg\" data=\"{{item}}\"/>\n        </block>\n\n        <!--a类型-->\n        <block wx:elif=\"{{item.tag == 'a'}}\">\n            <view bindtap=\"wxParseTagATap\" class=\"wxParse-inline {{item.classStr}} wxParse-{{item.tag}}\" data-c=\"{{item.attr.href}}\"  style=\"{{item.styleStr}}\">\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse1\" data=\"{{item}}\"/>\n                </block>\n            </view>\n        </block>\n        <block wx:elif=\"{{item.tag == 'table'}}\">\n            <view class=\"{{item.classStr}} wxParse-{{item.tag}}\" style=\"{{item.styleStr}}\">\n                <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                    <template is=\"wxParse1\" data=\"{{item}}\"/>                 \n                </block>\n            </view>\n        </block>\n\n        <!--其他块级标签-->\n        <block wx:elif=\"{{item.tagType == 'block'}}\">\n            <view class=\"{{item.classStr}} wxParse-{{item.tag}}\" style=\"{{item.styleStr}}\">\n                <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                    <template is=\"wxParse1\" data=\"{{item}}\"/>                 \n                </block>\n            </view>\n        </block>\n\n        <!--内联标签-->\n        <view wx:else class=\"{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}\" style=\"{{item.styleStr}}\">\n            <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                <template is=\"wxParse1\" data=\"{{item}}\"/>                 \n            </block>\n        </view>\n\n    </block>\n\n    <!--判断是否是文本节点-->\n    <block wx:elif=\"{{item.node == 'text'}}\">\n        <!--如果是，直接进行-->\n        <template is=\"WxEmojiView\" data=\"{{item}}\"/>\n    </block>\n\n</template>\n\n\n\n<!--循环模版-->\n<template name=\"wxParse1\">\n    <!--<template is=\"wxParse2\" data=\"{{item}}\" />-->\n    <!--判断是否是标签节点-->\n    <block wx:if=\"{{item.node == 'element'}}\">\n        <block wx:if=\"{{item.tag == 'button'}}\">\n            <button type=\"default\" size=\"mini\" >\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse2\" data=\"{{item}}\"/>\n                </block>\n             </button>\n        </block>\n        <!--li类型-->\n        <block wx:elif=\"{{item.tag == 'li'}}\">\n            <view class=\"{{item.classStr}} wxParse-li\">\n                <view class=\"{{item.classStr}} wxParse-li-inner\">\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <view class=\"{{item.classStr}} wxParse-li-circle\"></view>\n                    </view>\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                            <template is=\"wxParse2\" data=\"{{item}}\"/>\n                        </block>\n                    </view>\n                </view>\n            </view>\n        </block>\n\n        <!--video类型-->\n        <block wx:elif=\"{{item.tag == 'video'}}\">\n            <template is=\"wxParseVideo\" data=\"{{item}}\"/>  \n        </block>\n\n        <!--img类型-->\n        <block wx:elif=\"{{item.tag == 'img'}}\">\n            <template is=\"wxParseImg\" data=\"{{item}}\"/>\n        </block>\n\n        <!--a类型-->\n        <block wx:elif=\"{{item.tag == 'a'}}\">\n            <view bindtap=\"wxParseTagATap\" class=\"wxParse-inline {{item.classStr}} wxParse-{{item.tag}}\" data-src=\"{{item.attr.href}}\"  style=\"{{item.styleStr}}\">\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse2\" data=\"{{item}}\"/>\n                </block>\n            </view>\n        </block>\n        \n        <!--其他块级标签-->\n        <block wx:elif=\"{{item.tagType == 'block'}}\">\n            <view class=\"{{item.classStr}} wxParse-{{item.tag}}\" style=\"{{item.styleStr}}\">\n                <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                    <template is=\"wxParse2\" data=\"{{item}}\"/>                 \n                </block>\n            </view>\n        </block>\n\n        <!--内联标签-->\n        <view wx:else class=\"{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}\" style=\"{{item.styleStr}}\">\n            <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                <template is=\"wxParse2\" data=\"{{item}}\"/>                 \n            </block>\n        </view>\n\n    </block>\n\n    <!--判断是否是文本节点-->\n    <block wx:elif=\"{{item.node == 'text'}}\">\n        <!--如果是，直接进行-->\n        <template is=\"WxEmojiView\" data=\"{{item}}\"/>\n    </block>\n\n</template>\n\n\n<!--循环模版-->\n<template name=\"wxParse2\">\n    <!--<template is=\"wxParse3\" data=\"{{item}}\" />-->\n    <!--判断是否是标签节点-->\n    <block wx:if=\"{{item.node == 'element'}}\">\n        <block wx:if=\"{{item.tag == 'button'}}\">\n            <button type=\"default\" size=\"mini\" >\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse3\" data=\"{{item}}\"/>\n                </block>\n             </button>\n        </block>\n        <!--li类型-->\n        <block wx:elif=\"{{item.tag == 'li'}}\">\n            <view class=\"{{item.classStr}} wxParse-li\">\n                <view class=\"{{item.classStr}} wxParse-li-inner\">\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <view class=\"{{item.classStr}} wxParse-li-circle\"></view>\n                    </view>\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                            <template is=\"wxParse3\" data=\"{{item}}\"/>\n                        </block>\n                    </view>\n                </view>\n            </view>\n        </block>\n\n        <!--video类型-->\n        <block wx:elif=\"{{item.tag == 'video'}}\">\n            <template is=\"wxParseVideo\" data=\"{{item}}\"/>  \n        </block>\n\n        <!--img类型-->\n        <block wx:elif=\"{{item.tag == 'img'}}\">\n            <template is=\"wxParseImg\" data=\"{{item}}\"/>\n        </block>\n\n        <!--a类型-->\n        <block wx:elif=\"{{item.tag == 'a'}}\">\n            <view bindtap=\"wxParseTagATap\" class=\"wxParse-inline {{item.classStr}} wxParse-{{item.tag}}\" data-src=\"{{item.attr.href}}\"  style=\"{{item.styleStr}}\">\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse3\" data=\"{{item}}\"/>\n                </block>\n            </view>\n        </block>\n        \n        <!--其他块级标签-->\n        <block wx:elif=\"{{item.tagType == 'block'}}\">\n            <view class=\"{{item.classStr}} wxParse-{{item.tag}}\" style=\"{{item.styleStr}}\">\n                <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                    <template is=\"wxParse3\" data=\"{{item}}\"/>                 \n                </block>\n            </view>\n        </block>\n\n        <!--内联标签-->\n        <view wx:else class=\"{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}\" style=\"{{item.styleStr}}\">\n            <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                <template is=\"wxParse3\" data=\"{{item}}\"/>                 \n            </block>\n        </view>\n\n    </block>\n\n    <!--判断是否是文本节点-->\n    <block wx:elif=\"{{item.node == 'text'}}\">\n        <!--如果是，直接进行-->\n        <template is=\"WxEmojiView\" data=\"{{item}}\"/>\n    </block>\n\n</template>\n\n<!--循环模版-->\n<template name=\"wxParse3\">\n    <!--<template is=\"wxParse4\" data=\"{{item}}\" />-->\n    <!--判断是否是标签节点-->\n    <block wx:if=\"{{item.node == 'element'}}\">\n        <block wx:if=\"{{item.tag == 'button'}}\">\n            <button type=\"default\" size=\"mini\" >\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse4\" data=\"{{item}}\"/>\n                </block>\n             </button>\n        </block>\n        <!--li类型-->\n        <block wx:elif=\"{{item.tag == 'li'}}\">\n            <view class=\"{{item.classStr}} wxParse-li\">\n                <view class=\"{{item.classStr}} wxParse-li-inner\">\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <view class=\"{{item.classStr}} wxParse-li-circle\"></view>\n                    </view>\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                            <template is=\"wxParse4\" data=\"{{item}}\"/>\n                        </block>\n                    </view>\n                </view>\n            </view>\n        </block>\n\n        <!--video类型-->\n        <block wx:elif=\"{{item.tag == 'video'}}\">\n            <template is=\"wxParseVideo\" data=\"{{item}}\"/>  \n        </block>\n\n        <!--img类型-->\n        <block wx:elif=\"{{item.tag == 'img'}}\">\n            <template is=\"wxParseImg\" data=\"{{item}}\"/>\n        </block>\n\n        <!--a类型-->\n        <block wx:elif=\"{{item.tag == 'a'}}\">\n            <view bindtap=\"wxParseTagATap\" class=\"wxParse-inline {{item.classStr}} wxParse-{{item.tag}}\" data-src=\"{{item.attr.href}}\"  style=\"{{item.styleStr}}\">\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse4\" data=\"{{item}}\"/>\n                </block>\n            </view>\n        </block>\n        \n        <!--其他块级标签-->\n        <block wx:elif=\"{{item.tagType == 'block'}}\">\n            <view class=\"{{item.classStr}} wxParse-{{item.tag}}\" style=\"{{item.styleStr}}\">\n                <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                    <template is=\"wxParse4\" data=\"{{item}}\"/>                 \n                </block>\n            </view>\n        </block>\n\n        <!--内联标签-->\n        <view wx:else class=\"{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}\" style=\"{{item.styleStr}}\">\n            <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                <template is=\"wxParse4\" data=\"{{item}}\"/>                 \n            </block>\n        </view>\n\n    </block>\n\n    <!--判断是否是文本节点-->\n    <block wx:elif=\"{{item.node == 'text'}}\">\n        <!--如果是，直接进行-->\n        <template is=\"WxEmojiView\" data=\"{{item}}\"/>\n    </block>\n\n</template>\n\n<!--循环模版-->\n<template name=\"wxParse4\">\n    <!--<template is=\"wxParse5\" data=\"{{item}}\" />-->\n    <!--判断是否是标签节点-->\n    <block wx:if=\"{{item.node == 'element'}}\">\n        <block wx:if=\"{{item.tag == 'button'}}\">\n            <button type=\"default\" size=\"mini\" >\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse5\" data=\"{{item}}\"/>\n                </block>\n             </button>\n        </block>\n        <!--li类型-->\n        <block wx:elif=\"{{item.tag == 'li'}}\">\n            <view class=\"{{item.classStr}} wxParse-li\">\n                <view class=\"{{item.classStr}} wxParse-li-inner\">\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <view class=\"{{item.classStr}} wxParse-li-circle\"></view>\n                    </view>\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                            <template is=\"wxParse5\" data=\"{{item}}\"/>\n                        </block>\n                    </view>\n                </view>\n            </view>\n        </block>\n\n        <!--video类型-->\n        <block wx:elif=\"{{item.tag == 'video'}}\">\n            <template is=\"wxParseVideo\" data=\"{{item}}\"/>  \n        </block>\n\n        <!--img类型-->\n        <block wx:elif=\"{{item.tag == 'img'}}\">\n            <template is=\"wxParseImg\" data=\"{{item}}\"/>\n        </block>\n\n        <!--a类型-->\n        <block wx:elif=\"{{item.tag == 'a'}}\">\n            <view bindtap=\"wxParseTagATap\" class=\"wxParse-inline {{item.classStr}} wxParse-{{item.tag}}\" data-src=\"{{item.attr.href}}\"  style=\"{{item.styleStr}}\">\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse5\" data=\"{{item}}\"/>\n                </block>\n            </view>\n        </block>\n        \n        <!--其他块级标签-->\n        <block wx:elif=\"{{item.tagType == 'block'}}\">\n            <view class=\"{{item.classStr}} wxParse-{{item.tag}}\" style=\"{{item.styleStr}}\">\n                <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                    <template is=\"wxParse5\" data=\"{{item}}\"/>                 \n                </block>\n            </view>\n        </block>\n\n        <!--内联标签-->\n        <view wx:else class=\"{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}\" style=\"{{item.styleStr}}\">\n            <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                <template is=\"wxParse5\" data=\"{{item}}\"/>                 \n            </block>\n        </view>\n\n    </block>\n\n    <!--判断是否是文本节点-->\n    <block wx:elif=\"{{item.node == 'text'}}\">\n        <!--如果是，直接进行-->\n        <template is=\"WxEmojiView\" data=\"{{item}}\"/>\n    </block>\n\n</template>\n\n<!--循环模版-->\n<template name=\"wxParse5\">\n    <!--<template is=\"wxParse6\" data=\"{{item}}\" />-->\n    <!--判断是否是标签节点-->\n    <block wx:if=\"{{item.node == 'element'}}\">\n        <block wx:if=\"{{item.tag == 'button'}}\">\n            <button type=\"default\" size=\"mini\" >\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse6\" data=\"{{item}}\"/>\n                </block>\n             </button>\n        </block>\n        <!--li类型-->\n        <block wx:elif=\"{{item.tag == 'li'}}\">\n            <view class=\"{{item.classStr}} wxParse-li\">\n                <view class=\"{{item.classStr}} wxParse-li-inner\">\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <view class=\"{{item.classStr}} wxParse-li-circle\"></view>\n                    </view>\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                            <template is=\"wxParse6\" data=\"{{item}}\"/>\n                        </block>\n                    </view>\n                </view>\n            </view>\n        </block>\n\n        <!--video类型-->\n        <block wx:elif=\"{{item.tag == 'video'}}\">\n            <template is=\"wxParseVideo\" data=\"{{item}}\"/>  \n        </block>\n\n        <!--img类型-->\n        <block wx:elif=\"{{item.tag == 'img'}}\">\n            <template is=\"wxParseImg\" data=\"{{item}}\"/>\n        </block>\n\n        <!--a类型-->\n        <block wx:elif=\"{{item.tag == 'a'}}\">\n            <view bindtap=\"wxParseTagATap\" class=\"wxParse-inline {{item.classStr}} wxParse-{{item.tag}}\" data-src=\"{{item.attr.href}}\"  style=\"{{item.styleStr}}\">\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse6\" data=\"{{item}}\"/>\n                </block>\n            </view>\n        </block>\n        \n        <!--其他块级标签-->\n        <block wx:elif=\"{{item.tagType == 'block'}}\">\n            <view class=\"{{item.classStr}} wxParse-{{item.tag}}\" style=\"{{item.styleStr}}\">\n                <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                    <template is=\"wxParse6\" data=\"{{item}}\"/>                 \n                </block>\n            </view>\n        </block>\n\n        <!--内联标签-->\n        <view wx:else class=\"{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}\" style=\"{{item.styleStr}}\">\n            <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                <template is=\"wxParse6\" data=\"{{item}}\"/>                 \n            </block>\n        </view>\n\n    </block>\n\n    <!--判断是否是文本节点-->\n    <block wx:elif=\"{{item.node == 'text'}}\">\n        <!--如果是，直接进行-->\n        <template is=\"WxEmojiView\" data=\"{{item}}\"/>\n    </block>\n\n</template>\n\n<!--循环模版-->\n<template name=\"wxParse6\">\n    <!--<template is=\"wxParse7\" data=\"{{item}}\" />-->\n    <!--判断是否是标签节点-->\n    <block wx:if=\"{{item.node == 'element'}}\">\n        <block wx:if=\"{{item.tag == 'button'}}\">\n            <button type=\"default\" size=\"mini\" >\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse7\" data=\"{{item}}\"/>\n                </block>\n             </button>\n        </block>\n        <!--li类型-->\n        <block wx:elif=\"{{item.tag == 'li'}}\">\n            <view class=\"{{item.classStr}} wxParse-li\">\n                <view class=\"{{item.classStr}} wxParse-li-inner\">\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <view class=\"{{item.classStr}} wxParse-li-circle\"></view>\n                    </view>\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                            <template is=\"wxParse7\" data=\"{{item}}\"/>\n                        </block>\n                    </view>\n                </view>\n            </view>\n        </block>\n\n        <!--video类型-->\n        <block wx:elif=\"{{item.tag == 'video'}}\">\n            <template is=\"wxParseVideo\" data=\"{{item}}\"/>  \n        </block>\n\n        <!--img类型-->\n        <block wx:elif=\"{{item.tag == 'img'}}\">\n            <template is=\"wxParseImg\" data=\"{{item}}\"/>\n        </block>\n\n        <!--a类型-->\n        <block wx:elif=\"{{item.tag == 'a'}}\">\n            <view bindtap=\"wxParseTagATap\" class=\"wxParse-inline {{item.classStr}} wxParse-{{item.tag}}\" data-src=\"{{item.attr.href}}\"  style=\"{{item.styleStr}}\">\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse7\" data=\"{{item}}\"/>\n                </block>\n            </view>\n        </block>\n        \n        <!--其他块级标签-->\n        <block wx:elif=\"{{item.tagType == 'block'}}\">\n            <view class=\"{{item.classStr}} wxParse-{{item.tag}}\" style=\"{{item.styleStr}}\">\n                <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                    <template is=\"wxParse7\" data=\"{{item}}\"/>                 \n                </block>\n            </view>\n        </block>\n\n        <!--内联标签-->\n        <view wx:else class=\"{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}\" style=\"{{item.styleStr}}\">\n            <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                <template is=\"wxParse7\" data=\"{{item}}\"/>                 \n            </block>\n        </view>\n\n    </block>\n\n    <!--判断是否是文本节点-->\n    <block wx:elif=\"{{item.node == 'text'}}\">\n        <!--如果是，直接进行-->\n        <template is=\"WxEmojiView\" data=\"{{item}}\"/>\n    </block>\n\n</template>\n<!--循环模版-->\n<template name=\"wxParse7\">\n    <!--<template is=\"wxParse8\" data=\"{{item}}\" />-->\n    <!--判断是否是标签节点-->\n    <block wx:if=\"{{item.node == 'element'}}\">\n        <block wx:if=\"{{item.tag == 'button'}}\">\n            <button type=\"default\" size=\"mini\" >\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse8\" data=\"{{item}}\"/>\n                </block>\n             </button>\n        </block>\n        <!--li类型-->\n        <block wx:elif=\"{{item.tag == 'li'}}\">\n            <view class=\"{{item.classStr}} wxParse-li\">\n                <view class=\"{{item.classStr}} wxParse-li-inner\">\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <view class=\"{{item.classStr}} wxParse-li-circle\"></view>\n                    </view>\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                            <template is=\"wxParse8\" data=\"{{item}}\"/>\n                        </block>\n                    </view>\n                </view>\n            </view>\n        </block>\n\n        <!--video类型-->\n        <block wx:elif=\"{{item.tag == 'video'}}\">\n            <template is=\"wxParseVideo\" data=\"{{item}}\"/>  \n        </block>\n\n        <!--img类型-->\n        <block wx:elif=\"{{item.tag == 'img'}}\">\n            <template is=\"wxParseImg\" data=\"{{item}}\"/>\n        </block>\n\n        <!--a类型-->\n        <block wx:elif=\"{{item.tag == 'a'}}\">\n            <view bindtap=\"wxParseTagATap\" class=\"wxParse-inline {{item.classStr}} wxParse-{{item.tag}}\" data-src=\"{{item.attr.href}}\"  style=\"{{item.styleStr}}\">\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse8\" data=\"{{item}}\"/>\n                </block>\n            </view>\n        </block>\n        \n        <!--其他块级标签-->\n        <block wx:elif=\"{{item.tagType == 'block'}}\">\n            <view class=\"{{item.classStr}} wxParse-{{item.tag}}\" style=\"{{item.styleStr}}\">\n                <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                    <template is=\"wxParse8\" data=\"{{item}}\"/>                 \n                </block>\n            </view>\n        </block>\n\n        <!--内联标签-->\n        <view wx:else class=\"{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}\" style=\"{{item.styleStr}}\">\n            <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                <template is=\"wxParse8\" data=\"{{item}}\"/>                 \n            </block>\n        </view>\n\n    </block>\n\n    <!--判断是否是文本节点-->\n    <block wx:elif=\"{{item.node == 'text'}}\">\n        <!--如果是，直接进行-->\n        <template is=\"WxEmojiView\" data=\"{{item}}\"/>\n    </block>\n\n</template>\n\n<!--循环模版-->\n<template name=\"wxParse8\">\n    <!--<template is=\"wxParse9\" data=\"{{item}}\" />-->\n    <!--判断是否是标签节点-->\n    <block wx:if=\"{{item.node == 'element'}}\">\n        <block wx:if=\"{{item.tag == 'button'}}\">\n            <button type=\"default\" size=\"mini\" >\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse9\" data=\"{{item}}\"/>\n                </block>\n             </button>\n        </block>\n        <!--li类型-->\n        <block wx:elif=\"{{item.tag == 'li'}}\">\n            <view class=\"{{item.classStr}} wxParse-li\">\n                <view class=\"{{item.classStr}} wxParse-li-inner\">\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <view class=\"{{item.classStr}} wxParse-li-circle\"></view>\n                    </view>\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                            <template is=\"wxParse9\" data=\"{{item}}\"/>\n                        </block>\n                    </view>\n                </view>\n            </view>\n        </block>\n\n        <!--video类型-->\n        <block wx:elif=\"{{item.tag == 'video'}}\">\n            <template is=\"wxParseVideo\" data=\"{{item}}\"/>  \n        </block>\n\n        <!--img类型-->\n        <block wx:elif=\"{{item.tag == 'img'}}\">\n            <template is=\"wxParseImg\" data=\"{{item}}\"/>\n        </block>\n\n        <!--a类型-->\n        <block wx:elif=\"{{item.tag == 'a'}}\">\n            <view bindtap=\"wxParseTagATap\" class=\"wxParse-inline {{item.classStr}} wxParse-{{item.tag}}\" data-src=\"{{item.attr.href}}\"  style=\"{{item.styleStr}}\">\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse9\" data=\"{{item}}\"/>\n                </block>\n            </view>\n        </block>\n        \n        <!--其他块级标签-->\n        <block wx:elif=\"{{item.tagType == 'block'}}\">\n            <view class=\"{{item.classStr}} wxParse-{{item.tag}}\" style=\"{{item.styleStr}}\">\n                <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                    <template is=\"wxParse9\" data=\"{{item}}\"/>                 \n                </block>\n            </view>\n        </block>\n\n        <!--内联标签-->\n        <view wx:else class=\"{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}\" style=\"{{item.styleStr}}\">\n            <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                <template is=\"wxParse9\" data=\"{{item}}\"/>                 \n            </block>\n        </view>\n\n    </block>\n\n    <!--判断是否是文本节点-->\n    <block wx:elif=\"{{item.node == 'text'}}\">\n        <!--如果是，直接进行-->\n        <template is=\"WxEmojiView\" data=\"{{item}}\"/>\n    </block>\n\n</template>\n\n<!--循环模版-->\n<template name=\"wxParse9\">\n    <!--<template is=\"wxParse10\" data=\"{{item}}\" />-->\n    <!--判断是否是标签节点-->\n    <block wx:if=\"{{item.node == 'element'}}\">\n        <block wx:if=\"{{item.tag == 'button'}}\">\n            <button type=\"default\" size=\"mini\" >\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse10\" data=\"{{item}}\"/>\n                </block>\n             </button>\n        </block>\n        <!--li类型-->\n        <block wx:elif=\"{{item.tag == 'li'}}\">\n            <view class=\"{{item.classStr}} wxParse-li\">\n                <view class=\"{{item.classStr}} wxParse-li-inner\">\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <view class=\"{{item.classStr}} wxParse-li-circle\"></view>\n                    </view>\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                            <template is=\"wxParse10\" data=\"{{item}}\"/>\n                        </block>\n                    </view>\n                </view>\n            </view>\n        </block>\n\n        <!--video类型-->\n        <block wx:elif=\"{{item.tag == 'video'}}\">\n            <template is=\"wxParseVideo\" data=\"{{item}}\"/>  \n        </block>\n\n        <!--img类型-->\n        <block wx:elif=\"{{item.tag == 'img'}}\">\n            <template is=\"wxParseImg\" data=\"{{item}}\"/>\n        </block>\n\n        <!--a类型-->\n        <block wx:elif=\"{{item.tag == 'a'}}\">\n            <view bindtap=\"wxParseTagATap\" class=\"wxParse-inline {{item.classStr}} wxParse-{{item.tag}}\" data-src=\"{{item.attr.href}}\"  style=\"{{item.styleStr}}\">\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse10\" data=\"{{item}}\"/>\n                </block>\n            </view>\n        </block>\n        \n        <!--其他块级标签-->\n        <block wx:elif=\"{{item.tagType == 'block'}}\">\n            <view class=\"{{item.classStr}} wxParse-{{item.tag}}\" style=\"{{item.styleStr}}\">\n                <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                    <template is=\"wxParse10\" data=\"{{item}}\"/>                 \n                </block>\n            </view>\n        </block>\n\n        <!--内联标签-->\n        <view wx:else class=\"{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}\" style=\"{{item.styleStr}}\">\n            <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                <template is=\"wxParse10\" data=\"{{item}}\"/>                 \n            </block>\n        </view>\n\n    </block>\n\n    <!--判断是否是文本节点-->\n    <block wx:elif=\"{{item.node == 'text'}}\">\n        <!--如果是，直接进行-->\n        <template is=\"WxEmojiView\" data=\"{{item}}\"/>\n    </block>\n\n</template>\n\n<!--循环模版-->\n<template name=\"wxParse10\">\n    <!--<template is=\"wxParse11\" data=\"{{item}}\" />-->\n    <!--判断是否是标签节点-->\n    <block wx:if=\"{{item.node == 'element'}}\">\n        <block wx:if=\"{{item.tag == 'button'}}\">\n            <button type=\"default\" size=\"mini\" >\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse11\" data=\"{{item}}\"/>\n                </block>\n             </button>\n        </block>\n        <!--li类型-->\n        <block wx:elif=\"{{item.tag == 'li'}}\">\n            <view class=\"{{item.classStr}} wxParse-li\">\n                <view class=\"{{item.classStr}} wxParse-li-inner\">\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <view class=\"{{item.classStr}} wxParse-li-circle\"></view>\n                    </view>\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                            <template is=\"wxParse11\" data=\"{{item}}\"/>\n                        </block>\n                    </view>\n                </view>\n            </view>\n        </block>\n\n        <!--video类型-->\n        <block wx:elif=\"{{item.tag == 'video'}}\">\n            <template is=\"wxParseVideo\" data=\"{{item}}\"/>  \n        </block>\n\n        <!--img类型-->\n        <block wx:elif=\"{{item.tag == 'img'}}\">\n            <template is=\"wxParseImg\" data=\"{{item}}\"/>\n        </block>\n\n        <!--a类型-->\n        <block wx:elif=\"{{item.tag == 'a'}}\">\n            <view bindtap=\"wxParseTagATap\" class=\"wxParse-inline {{item.classStr}} wxParse-{{item.tag}}\" data-src=\"{{item.attr.href}}\"  style=\"{{item.styleStr}}\">\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse11\" data=\"{{item}}\"/>\n                </block>\n            </view>\n        </block>\n        \n        <!--其他块级标签-->\n        <block wx:elif=\"{{item.tagType == 'block'}}\">\n            <view class=\"{{item.classStr}} wxParse-{{item.tag}}\" style=\"{{item.styleStr}}\">\n                <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                    <template is=\"wxParse11\" data=\"{{item}}\"/>                 \n                </block>\n            </view>\n        </block>\n\n        <!--内联标签-->\n        <view wx:else class=\"{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}\" style=\"{{item.styleStr}}\">\n            <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                <template is=\"wxParse11\" data=\"{{item}}\"/>                 \n            </block>\n        </view>\n\n    </block>\n\n    <!--判断是否是文本节点-->\n    <block wx:elif=\"{{item.node == 'text'}}\">\n        <!--如果是，直接进行-->\n        <template is=\"WxEmojiView\" data=\"{{item}}\"/>\n    </block>\n\n</template>\n\n<!--循环模版-->\n<template name=\"wxParse11\">\n    <!--<template is=\"wxParse12\" data=\"{{item}}\" />-->\n    <!--判断是否是标签节点-->\n    <block wx:if=\"{{item.node == 'element'}}\">\n        <block wx:if=\"{{item.tag == 'button'}}\">\n            <button type=\"default\" size=\"mini\" >\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse12\" data=\"{{item}}\"/>\n                </block>\n             </button>\n        </block>\n        <!--li类型-->\n        <block wx:elif=\"{{item.tag == 'li'}}\">\n            <view class=\"{{item.classStr}} wxParse-li\">\n                <view class=\"{{item.classStr}} wxParse-li-inner\">\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <view class=\"{{item.classStr}} wxParse-li-circle\"></view>\n                    </view>\n                    <view class=\"{{item.classStr}} wxParse-li-text\">\n                        <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                            <template is=\"wxParse12\" data=\"{{item}}\"/>\n                        </block>\n                    </view>\n                </view>\n            </view>\n        </block>\n\n        <!--video类型-->\n        <block wx:elif=\"{{item.tag == 'video'}}\">\n            <template is=\"wxParseVideo\" data=\"{{item}}\"/>  \n        </block>\n\n        <!--img类型-->\n        <block wx:elif=\"{{item.tag == 'img'}}\">\n            <template is=\"wxParseImg\" data=\"{{item}}\"/>\n        </block>\n\n        <!--a类型-->\n        <block wx:elif=\"{{item.tag == 'a'}}\">\n            <view bindtap=\"wxParseTagATap\" class=\"wxParse-inline {{item.classStr}} wxParse-{{item.tag}}\" data-src=\"{{item.attr.href}}\"  style=\"{{item.styleStr}}\">\n                <block wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">\n                    <template is=\"wxParse12\" data=\"{{item}}\"/>\n                </block>\n            </view>\n        </block>\n        \n        <!--其他块级标签-->\n        <block wx:elif=\"{{item.tagType == 'block'}}\">\n            <view class=\"{{item.classStr}} wxParse-{{item.tag}}\" style=\"{{item.styleStr}}\">\n                <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                    <template is=\"wxParse12\" data=\"{{item}}\"/>                 \n                </block>\n            </view>\n        </block>\n\n        <!--内联标签-->\n        <view wx:else class=\"{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}\" style=\"{{item.styleStr}}\">\n            <block  wx:for=\"{{item.nodes}}\" wx:for-item=\"item\" wx:key=\"\">       \n                <template is=\"wxParse12\" data=\"{{item}}\"/>                 \n            </block>\n        </view>\n\n    </block>\n\n    <!--判断是否是文本节点-->\n    <block wx:elif=\"{{item.node == 'text'}}\">\n        <!--如果是，直接进行-->\n        <template is=\"WxEmojiView\" data=\"{{item}}\"/>\n    </block>\n\n</template>"
  },
  {
    "path": "lib/wxParse/wxParse.wxss",
    "content": "\n/**\n * author: Di (微信小程序开发工程师)\n * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)\n *               垂直微信小程序开发交流社区\n * \n * github地址: https://github.com/icindy/wxParse\n * \n * for: 微信小程序富文本解析\n * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184\n */\n\n.wxParse{\n    margin: 0 5px;\n    font-family: Helvetica,sans-serif;\n    font-size: 28rpx;\n    color: #666;\n    line-height: 1.8;\n}\nview{\n    word-break:break-all; overflow:auto;\n}\n.wxParse-inline{\n    display: inline;\n    margin: 0;\n    padding: 0;\n}\n/*//标题 */\n.wxParse-div{margin: 0;padding: 0;}\n.wxParse-h1{ font-size:2em; margin: .67em 0 }\n.wxParse-h2{ font-size:1.5em; margin: .75em 0 }\n.wxParse-h3{ font-size:1.17em; margin: .83em 0 }\n.wxParse-h4{ margin: 1.12em 0}\n.wxParse-h5 { font-size:.83em; margin: 1.5em 0 }\n.wxParse-h6{ font-size:.75em; margin: 1.67em 0 }\n\n.wxParse-h1 {\n  font-size: 18px;\n  font-weight: 400;\n  margin-bottom: .9em;\n}\n.wxParse-h2 {\n  font-size: 16px;\n  font-weight: 400;\n  margin-bottom: .34em;\n}\n.wxParse-h3 {\n  font-weight: 400;\n  font-size: 15px;\n  margin-bottom: .34em;\n}\n.wxParse-h4 {\n  font-weight: 400;\n  font-size: 14px;\n  margin-bottom: .24em;\n}\n.wxParse-h5 {\n  font-weight: 400;\n  font-size: 13px;\n  margin-bottom: .14em;\n}\n.wxParse-h6 {\n  font-weight: 400;\n  font-size: 12px;\n  margin-bottom: .04em;\n}\n\n.wxParse-h1, .wxParse-h2, .wxParse-h3, .wxParse-h4, .wxParse-h5, .wxParse-h6, .wxParse-b, .wxParse-strong  { font-weight: bolder }\n\n.wxParse-i,.wxParse-cite,.wxParse-em,.wxParse-var,.wxParse-address{font-style:italic}\n.wxParse-pre,.wxParse-tt,.wxParse-code,.wxParse-kbd,.wxParse-samp{font-family:monospace}\n.wxParse-pre{white-space:pre}\n.wxParse-big{font-size:1.17em}\n.wxParse-small,.wxParse-sub,.wxParse-sup{font-size:.83em}\n.wxParse-sub{vertical-align:sub}\n.wxParse-sup{vertical-align:super}\n.wxParse-s,.wxParse-strike,.wxParse-del{text-decoration:line-through}\n/*wxparse-自定义个性化的css样式*/\n/*增加video的css样式*/\n.wxParse-strong,wxParse-s{display: inline}\n.wxParse-a{\n    color: deepskyblue;\n    word-break:break-all;\n    overflow:auto;\n}\n\n.wxParse-video{\n    text-align: center;\n    margin: 10px 0;\n}\n\n.wxParse-video-video{\n    width:100%;\n}\n\n.wxParse-img{\n    background-color: #efefef;\n    overflow: hidden;\n    width:40px;\n    height: 40px;\n}\n\n.wxParse-blockquote {\n    margin: 0;\n    padding:10px 0 10px 5px;\n    font-family:Courier, Calibri,\"宋体\";\n    background:#f5f5f5;\n    border-left: 3px solid #dbdbdb;\n}\n\n.wxParse-code,.wxParse-wxxxcode-style{\n    display: inline;\n    background:#f5f5f5;\n}\n.wxParse-ul{\n    margin: 20rpx 10rpx;\n}\n\n.wxParse-li,.wxParse-li-inner{\n    display: flex;\n    align-items: baseline;\n    margin: 10rpx 0;\n}\n.wxParse-li-text{\n    \n    align-items: center;\n    line-height: 20px;\n}\n\n.wxParse-li-circle{\n    display: inline-flex;\n    width: 5px;\n    height: 5px;\n    background-color: #333;\n    margin-right: 5px;\n}\n\n.wxParse-li-square{\n    display: inline-flex;\n    width: 10rpx;\n    height: 10rpx;\n    background-color: #333;\n    margin-right: 5px;\n}\n.wxParse-li-ring{\n    display: inline-flex;\n    width: 10rpx;\n    height: 10rpx;\n    border: 2rpx solid #333;\n    border-radius: 50%;\n    background-color: #fff;\n    margin-right: 5px;\n}\n\n/*.wxParse-table{\n    width: 100%;\n    height: 400px;\n}\n.wxParse-thead,.wxParse-tfoot,.wxParse-tr{\n    display: flex;\n    flex-direction: row;\n}\n.wxParse-th,.wxParse-td{\n    display: flex;\n    width: 580px;\n    overflow: auto;\n}*/\n\n.wxParse-u {\n  text-decoration: underline;\n}\n.wxParse-hide{\n    display: none;\n}\n.WxEmojiView{\n    align-items: center;\n}\n.wxEmoji{\n    width: 16px;\n    height:16px;\n}\n.wxParse-tr{\n\tdisplay: flex;\n\tborder-right:1px solid #e0e0e0;\n\tborder-bottom:1px solid #e0e0e0;\n}\n.wxParse-th,\n.wxParse-td{\n\tflex:1;\n\tpadding:5px;\n\tfont-size:28rpx;\n\tborder-left:1px solid #e0e0e0;\n\tword-break: break-all;\n}\n.wxParse-td:last{\n\tborder-top:1px solid #e0e0e0;\n}\n.wxParse-th{\n\tbackground:#f0f0f0;\n\tborder-top:1px solid #e0e0e0;\n}\n\n"
  },
  {
    "path": "pages/auth/login/login.js",
    "content": "var api = require('../../../config/api.js');\nvar app = getApp();\nPage({\n  data: {\n    username: '',\n    password: '',\n    code: '',\n    loginErrorCount: 0\n  },\n  onLoad: function (options) {\n    // 页面初始化 options为页面跳转所带来的参数\n    // 页面渲染完成\n\n  },\n  onReady: function () {\n\n  },\n  onShow: function () {\n    // 页面显示\n  },\n  onHide: function () {\n    // 页面隐藏\n\n  },\n  onUnload: function () {\n    // 页面关闭\n\n  },\n  startLogin: function () {\n    var that = this;\n\n    if (that.data.password.length < 1 || that.data.username.length < 1) {\n      wx.showModal({\n        title: '错误信息',\n        content: '请输入用户名和密码',\n        showCancel: false\n      });\n      return false;\n    }\n\n    wx.request({\n      url: api.ApiRootUrl + 'auth/login',\n      data: {\n        username: that.data.username,\n        password: that.data.password\n      },\n      method: 'POST',\n      header: {\n        'content-type': 'application/json'\n      },\n      success: function (res) {\n        if(res.data.code == 200){\n          that.setData({\n            'loginErrorCount': 0\n          });\n          wx.setStorage({\n            key:\"token\",\n            data: res.data.data.token,\n            success: function(){\n              wx.switchTab({\n                url: '/pages/ucenter/index/index'\n              });\n            }\n          });\n        }\n      }\n    });\n  },\n  bindUsernameInput: function (e) {\n\n    this.setData({\n      username: e.detail.value\n    });\n  },\n  bindPasswordInput: function (e) {\n\n    this.setData({\n      password: e.detail.value\n    });\n  },\n  bindCodeInput: function (e) {\n\n    this.setData({\n      code: e.detail.value\n    });\n  },\n  clearInput: function (e) {\n    switch (e.currentTarget.id) {\n      case 'clear-username':\n        this.setData({\n          username: ''\n        });\n        break;\n      case 'clear-password':\n        this.setData({\n          password: ''\n        });\n        break;\n      case 'clear-code':\n        this.setData({\n          code: ''\n        });\n        break;\n    }\n  }\n})"
  },
  {
    "path": "pages/auth/login/login.json",
    "content": "{}"
  },
  {
    "path": "pages/auth/login/login.wxml",
    "content": "<view class=\"container\">\n    <view class=\"form-box\">\n\n    \t<view class=\"form-item\">\n    \t\t<input class=\"username\" value=\"{{username}}\" bindinput=\"bindUsernameInput\" placeholder=\"账号\" auto-focus/>\n    \t\t<image wx:if=\"{{ username.length > 0 }}\" id=\"clear-username\" class=\"clear\" src=\"/static/images/clear_input.png\" catchtap=\"clearInput\"></image>\n    \t</view>\n\n    \t<view class=\"form-item\">\n    \t\t<input class=\"password\" value=\"{{password}}\" password bindinput=\"bindPasswordInput\" placeholder=\"密码\"/>\n    \t\t<image class=\"clear\" id=\"clear-password\" wx:if=\"{{ password.length > 0 }}\" src=\"/static/images/clear_input.png\" catchtap=\"clearInput\"></image>\n    \t</view>\n\n\t\t<view class=\"form-item-code\" wx-if=\"{{loginErrorCount >= 3}}\">\n\t\t\t<view class=\"form-item code-item\">\n\t\t\t\t<input class=\"code\" value=\"{{code}}\" bindinput=\"bindCodeInput\" placeholder=\"验证码\"/>\n\t\t\t\t<image class=\"clear\" id=\"clear-code\" wx:if=\"{{ code.length > 0 }}\" src=\"/static/images/clear_input.png\" catchtap=\"clearInput\"></image>\n\t\t\t</view>\n\t\t\t<image class=\"code-img\" src=\"https://dl.reg.163.com/cp?pd=yanxuan_web&pkid=SkeBZeG&random=1489903563234\"></image>\n\t\t</view>\n\n    \t<button type=\"default\" class=\"login-btn\" bindtap=\"startLogin\">登录</button>\n\n    \t<view class=\"form-item-text\">\n    \t\t<navigator url=\"/pages/auth/register/register\" class=\"register\">注册账号</navigator>\n\t\t\t<navigator url=\"/pages/auth/reset/reset\" class=\"reset\">忘记密码</navigator>\n    \t</view>\n\n    </view>\n</view>"
  },
  {
    "path": "pages/auth/login/login.wxss",
    "content": ".form-box{\n    width: 100%;\n    height: auto;\n    overflow: hidden;\n    padding: 0 40rpx;\n    margin-top: 96rpx;\n    background: #fff;\n}\n\n.form-item{\n    position: relative;\n    background: #fff;\n    height: 96rpx;\n    border-bottom: 1px solid #d9d9d9;\n}\n\n.form-item .username, .form-item .password, .form-item .code{\n    position: absolute;\n    top: 26rpx;\n    left: 0;\n    display: block;\n    width: 100%;\n    height: 44rpx;\n    background: #fff;\n    color: #333;\n    font-size: 30rpx;\n}\n\n.form-item-code{\n    margin-top:32rpx;\n    height: auto;\n    overflow: hidden;\n    width: 100%;\n}\n\n.form-item-code .form-item{\n    float: left;\n    width: 350rpx;\n}\n\n.form-item-code .code-img{\n    float: right;\n    margin-top: 4rpx;\n    height: 88rpx;\n    width: 236rpx;\n}\n\n.form-item .clear{\n    position: absolute;\n    top: 26rpx;\n    right: 18rpx;\n    z-index: 2;\n    display: block;\n    background: #fff;\n    height: 44rpx;\n    width: 44rpx;\n}\n\n.login-btn{\n    margin: 60rpx 0 40rpx 0;\n    height: 96rpx;\n    line-height: 96rpx;\n    color: #fff;\n    font-size: 30rpx;\n    width: 100%;\n    background: #b4282d;\n    border-radius: 6rpx;\n}\n\n.form-item-text{\n    height: 35rpx;\n    width: 100%;\n}\n\n.form-item-text .register{\n    display: block;\n    height: 34rpx;\n    float: left;\n    font-size: 28rpx;\n    color: #999;\n}\n\n.form-item-text .reset{\n    display: block;\n    height: 34rpx;\n    float: right;\n    font-size: 28rpx;\n    color: #999;\n}"
  },
  {
    "path": "pages/auth/register/register.js",
    "content": "var api = require('../../../config/api.js');\nvar app = getApp();\nPage({\n  data: {\n    username: '',\n    password: '',\n    confirmPassword: '',\n    code: '',\n    loginErrorCount: 0\n  },\n  onLoad: function (options) {\n    // 页面初始化 options为页面跳转所带来的参数\n    // 页面渲染完成\n\n  },\n  onReady: function () {\n\n  },\n  onShow: function () {\n    // 页面显示\n\n  },\n  onHide: function () {\n    // 页面隐藏\n\n  },\n  onUnload: function () {\n    // 页面关闭\n\n  },\n  startRegister: function () {\n    var that = this;\n\n    if (that.data.password.length < 3 || that.data.username.length < 3) {\n      wx.showModal({\n        title: '错误信息',\n        content: '用户名和密码不得少于3位',\n        showCancel: false\n      });\n      return false;\n    }\n\n    if (that.data.password != that.data.confirmPassword) {\n      wx.showModal({\n        title: '错误信息',\n        content: '确认密码不一致',\n        showCancel: false\n      });\n      return false;\n    }\n\n    wx.request({\n      url: api.ApiRootUrl + 'auth/register',\n      data: {\n        username: that.data.username,\n        password: that.data.password\n      },\n      method: 'POST',\n      header: {\n        'content-type': 'application/json'\n      },\n      success: function (res) {\n        if (res.data.code == 200) {\n          that.setData({\n            'loginErrorCount': 0\n          });\n          wx.setStorage({\n            key: \"token\",\n            data: res.data.data.token,\n            success: function () {\n              wx.switchTab({\n                url: '/pages/ucenter/index/index'\n              });\n            }\n          });\n\n        }\n        console.log(res.data.data.token)\n      }\n    });\n  },\n  bindUsernameInput: function (e) {\n\n    this.setData({\n      username: e.detail.value\n    });\n  },\n  bindPasswordInput: function (e) {\n\n    this.setData({\n      password: e.detail.value\n    });\n  },\n  bindConfirmPasswordInput: function (e) {\n\n    this.setData({\n      confirmPassword: e.detail.value\n    });\n  },\n  bindCodeInput: function (e) {\n\n    this.setData({\n      code: e.detail.value\n    });\n  },\n  clearInput: function (e) {\n    switch (e.currentTarget.id) {\n      case 'clear-username':\n        this.setData({\n          username: ''\n        });\n        break;\n      case 'clear-password':\n        this.setData({\n          password: ''\n        });\n        break;\n      case 'clear-confirm-password':\n        this.setData({\n          confirmPassword: ''\n        });\n        break;\n      case 'clear-code':\n        this.setData({\n          code: ''\n        });\n        break;\n    }\n  }\n})"
  },
  {
    "path": "pages/auth/register/register.json",
    "content": "{}"
  },
  {
    "path": "pages/auth/register/register.wxml",
    "content": "<view class=\"container\">\n    <view class=\"form-box\">\n\n    \t<view class=\"form-item\">\n    \t\t<input class=\"username\" value=\"{{username}}\" bindinput=\"bindUsernameInput\" placeholder=\"用户名\" auto-focus/>\n    \t\t<image wx:if=\"{{ username.length > 0 }}\" id=\"clear-username\" class=\"clear\" src=\"/static/images/clear_input.png\" catchtap=\"clearInput\"></image>\n    \t</view>\n\n    \t<view class=\"form-item\">\n    \t\t<input class=\"password\" value=\"{{password}}\" password bindinput=\"bindPasswordInput\" placeholder=\"密码\"/>\n    \t\t<image class=\"clear\" id=\"clear-password\" wx:if=\"{{ password.length > 0 }}\" src=\"/static/images/clear_input.png\" catchtap=\"clearInput\"></image>\n    \t</view>\n\n        <view class=\"form-item\">\n    \t\t<input class=\"password\" value=\"{{confirmPassword}}\" password bindinput=\"bindConfirmPasswordInput\" placeholder=\"确认密码\"/>\n    \t\t<image class=\"clear\" id=\"clear-confirm-password\" wx:if=\"{{ confirmPassword.length > 0 }}\" src=\"/static/images/clear_input.png\" catchtap=\"clearInput\"></image>\n    \t</view>\n\n\t\t<view class=\"form-item-code\" >\n\t\t\t<view class=\"form-item code-item\">\n\t\t\t\t<input class=\"code\" value=\"{{code}}\" bindinput=\"bindCodeInput\" placeholder=\"验证码\"/>\n\t\t\t\t<image class=\"clear\" id=\"clear-code\" wx:if=\"{{ code.length > 0 }}\" src=\"/static/images/clear_input.png\" catchtap=\"clearInput\"></image>\n\t\t\t</view>\n\t\t\t<image class=\"code-img\" src=\"https://dl.reg.163.com/cp?pd=yanxuan_web&pkid=SkeBZeG&random=1489903563234\"></image>\n\t\t</view>\n\n    \t<button type=\"default\" class=\"login-btn\" bindtap=\"startRegister\">注册</button>\n\n    </view>\n</view>"
  },
  {
    "path": "pages/auth/register/register.wxss",
    "content": ".form-box{\n    width: 100%;\n    height: auto;\n    overflow: hidden;\n    padding: 0 40rpx;\n    margin-top: 96rpx;\n    background: #fff;\n}\n\n.form-item{\n    position: relative;\n    background: #fff;\n    height: 96rpx;\n    border-bottom: 1px solid #d9d9d9;\n}\n\n.form-item .username, .form-item .password, .form-item .code{\n    position: absolute;\n    top: 26rpx;\n    left: 0;\n    display: block;\n    width: 100%;\n    height: 44rpx;\n    background: #fff;\n    color: #333;\n    font-size: 30rpx;\n}\n\n.form-item-code{\n    margin-top:32rpx;\n    height: auto;\n    overflow: hidden;\n    width: 100%;\n}\n\n.form-item-code .form-item{\n    float: left;\n    width: 350rpx;\n}\n\n.form-item-code .code-img{\n    float: right;\n    margin-top: 4rpx;\n    height: 88rpx;\n    width: 236rpx;\n}\n\n.form-item .clear{\n    position: absolute;\n    top: 26rpx;\n    right: 18rpx;\n    z-index: 2;\n    display: block;\n    background: #fff;\n    height: 44rpx;\n    width: 44rpx;\n}\n\n.login-btn{\n    margin: 60rpx 0 40rpx 0;\n    height: 96rpx;\n    line-height: 96rpx;\n    color: #fff;\n    font-size: 30rpx;\n    width: 100%;\n    background: #b4282d;\n    border-radius: 6rpx;\n}\n\n.form-item-text{\n    height: 35rpx;\n    width: 100%;\n}\n\n.form-item-text .register{\n    display: block;\n    height: 34rpx;\n    float: left;\n    font-size: 28rpx;\n    color: #999;\n}\n\n.form-item-text .reset{\n    display: block;\n    height: 34rpx;\n    float: right;\n    font-size: 28rpx;\n    color: #999;\n}"
  },
  {
    "path": "pages/auth/reset/reset.js",
    "content": "var app = getApp();\nPage({\n  data: {\n    username: '',\n    code: ''\n  },\n  onLoad: function (options) {\n    // 页面初始化 options为页面跳转所带来的参数\n    // 页面渲染完成\n    \n  },\n  onReady: function () {\n\n  },\n  onShow: function () {\n    // 页面显示\n\n  },\n  onHide: function () {\n    // 页面隐藏\n\n  },\n  onUnload: function () {\n    // 页面关闭\n\n  },\n  startLogin: function(){\n    var that = this;\n  },\n  bindUsernameInput: function(e){\n    \n    this.setData({\n      username: e.detail.value\n    });\n  },\n  bindCodeInput: function(e){\n    \n    this.setData({\n      code: e.detail.value\n    });\n  },\n  clearInput: function(e){\n    switch (e.currentTarget.id){\n      case 'clear-username':\n        this.setData({\n          username: ''\n        });\n        break;\n        case 'clear-code':\n        this.setData({\n          code: ''\n        });\n        break;\n    }\n  }\n})"
  },
  {
    "path": "pages/auth/reset/reset.json",
    "content": "{}"
  },
  {
    "path": "pages/auth/reset/reset.wxml",
    "content": "<view class=\"container\">\n    <view class=\"form-box\">\n\n    \t<view class=\"form-item\">\n    \t\t<input class=\"username\" value=\"{{username}}\" bindinput=\"bindUsernameInput\" placeholder=\"请输入账号\" auto-focus/>\n    \t\t<image wx:if=\"{{ username.length > 0 }}\" id=\"clear-username\" class=\"clear\" src=\"/static/images/clear_input.png\" catchtap=\"clearInput\"></image>\n    \t</view>\n\n\t\t<view class=\"form-item-code\" >\n\t\t\t<view class=\"form-item code-item\">\n\t\t\t\t<input class=\"code\" value=\"{{code}}\" bindinput=\"bindCodeInput\" placeholder=\"验证码\"/>\n\t\t\t\t<image class=\"clear\" id=\"clear-code\" wx:if=\"{{ code.length > 0 }}\" src=\"/static/images/clear_input.png\" catchtap=\"clearInput\"></image>\n\t\t\t</view>\n\t\t\t<image class=\"code-img\" src=\"https://dl.reg.163.com/cp?pd=yanxuan_web&pkid=SkeBZeG&random=1489903563234\"></image>\n\t\t</view>\n\n    \t<button type=\"default\" class=\"login-btn\" bindtap=\"startNext\">下一步</button>\n\n    </view>\n</view>"
  },
  {
    "path": "pages/auth/reset/reset.wxss",
    "content": ".form-box{\n    width: 100%;\n    height: auto;\n    overflow: hidden;\n    padding: 0 40rpx;\n    margin-top: 96rpx;\n    background: #fff;\n}\n\n.form-item{\n    position: relative;\n    background: #fff;\n    height: 96rpx;\n    border-bottom: 1px solid #d9d9d9;\n}\n\n.form-item .username, .form-item .code{\n    position: absolute;\n    top: 26rpx;\n    left: 0;\n    display: block;\n    width: 100%;\n    height: 44rpx;\n    background: #fff;\n    color: #333;\n    font-size: 30rpx;\n}\n\n.form-item-code{\n    margin-top:32rpx;\n    height: auto;\n    overflow: hidden;\n    width: 100%;\n}\n\n.form-item-code .form-item{\n    float: left;\n    width: 350rpx;\n}\n\n.form-item-code .code-img{\n    float: right;\n    margin-top: 4rpx;\n    height: 88rpx;\n    width: 236rpx;\n}\n\n.form-item .clear{\n    position: absolute;\n    top: 26rpx;\n    right: 18rpx;\n    z-index: 2;\n    display: block;\n    background: #fff;\n    height: 44rpx;\n    width: 44rpx;\n}\n\n.login-btn{\n    margin: 60rpx 0 40rpx 0;\n    height: 96rpx;\n    line-height: 96rpx;\n    color: #fff;\n    font-size: 30rpx;\n    width: 100%;\n    background: #b4282d;\n    border-radius: 6rpx;\n}\n"
  },
  {
    "path": "pages/brand/brand.js",
    "content": "var util = require('../../utils/util.js');\nvar api = require('../../config/api.js');\nvar app = getApp();\nPage({\n  data: {\n    brandList: [],\n    page: 1,\n    size: 10,\n    totalPages: 1\n  },\n  onLoad: function (options) {\n    // 页面初始化 options为页面跳转所带来的参数\n    this.getBrandList();\n  },\n  getBrandList: function () {\n    wx.showLoading({\n      title: '加载中...',\n    });\n    let that = this;\n    util.request(api.BrandList, { page: that.data.page, size: that.data.size }).then(function (res) {\n      if (res.errno === 0) {\n        that.setData({\n          brandList: that.data.brandList.concat(res.data.data),\n          totalPages: res.data.totalPages\n        });\n      }\n      wx.hideLoading();\n    });\n  },\n  onReachBottom (){\n    if (this.data.totalPages > this.data.page) {\n      this.setData({\n        page: this.data.page + 1\n      });\n    } else {\n      return false;\n    }\n\n    this.getBrandList();\n  },\n  onReady: function () {\n\n  },\n  onShow: function () {\n    // 页面显示\n\n  },\n  onHide: function () {\n    // 页面隐藏\n\n  },\n  onUnload: function () {\n    // 页面关闭\n\n  }\n})"
  },
  {
    "path": "pages/brand/brand.json",
    "content": "{}"
  },
  {
    "path": "pages/brand/brand.wxml",
    "content": "<view class=\"container\">\n    <view class=\"brand-list\" >\n        <navigator url=\"../brandDetail/brandDetail?id={{item.id}}\"  class=\"item\" wx:for=\"{{brandList}}\" wx:key=\"id\">\n            <view class=\"img-bg\">\n                <image src=\"{{item.app_list_pic_url}}\" background-size=\"cover\"></image>\n            </view>\n            <view class=\"txt-box\">\n                <view class=\"line\">\n                    <text class=\"name\" >{{item.name}}</text>\n                    <text class=\"s\">|</text>\n                    <text class=\"price\">{{item.floor_price}}元起</text>\n                </view>\n            </view>\n        </navigator >\n    </view>\n</view>"
  },
  {
    "path": "pages/brand/brand.wxss",
    "content": ".brand-list .item{\n    display: block;\n    width: 750rpx;\n    height: 416rpx;\n    position: relative;\n    margin-bottom: 4rpx;\n}\n\n.brand-list .item .img-bg{\n    position: absolute;\n    left:0;\n    top:0;\n    z-index: 0;\n    width: 750rpx;\n    height: 417rpx;\n    overflow: hidden;\n}\n\n.brand-list .item .img-bg image{\n    width: 750rpx;\n    height: 416rpx;\n}\n\n.brand-list .item .txt-box{\n    position: absolute;\n    left:0;\n    top:0;\n    display: table;\n    z-index: 0;\n    width: 750rpx;\n    height: 417rpx;\n}\n\n.brand-list .item .line{\n    display: table-cell;\n    vertical-align: middle;\n    text-align: center;\n    height: 63rpx;\n    line-height: 63rpx;\n}\n\n.brand-list .item .line text{\n    font-size: 35rpx;\n    font-weight: 700;\n    text-shadow: 1rpx 1rpx rgba(0,0,0,.32);\n    color: #fff;\n}\n\n.brand-list .item .line .s{\n    padding: 0 10rpx;\n    font-size: 40rpx;\n}"
  },
  {
    "path": "pages/brandDetail/brandDetail.js",
    "content": "var util = require('../../utils/util.js');\nvar api = require('../../config/api.js');\n\n\nvar app = getApp();\n\nPage({\n  data: {\n    id: 0,\n    brand: {},\n    goodsList: [],\n    page: 1,\n    size: 1000\n  },\n  onLoad: function (options) {\n    // 页面初始化 options为页面跳转所带来的参数\n    var that = this;\n    that.setData({\n      id: parseInt(options.id)\n    });\n    this.getBrand();\n  },\n  getBrand: function () {\n    let that = this;\n    util.request(api.BrandDetail, { id: that.data.id }).then(function (res) {\n      if (res.errno === 0) {\n        that.setData({\n          brand: res.data.brand\n        });\n\n        that.getGoodsList();\n      }\n    });\n  },\n  getGoodsList() {\n    var that = this;\n\n    util.request(api.GoodsList, { brandId: that.data.id, page: that.data.page, size: that.data.size})\n      .then(function (res) {\n        if (res.errno === 0) {\n          that.setData({\n            goodsList: res.data.goodsList\n          });\n        }\n      });\n  },\n  onReady: function () {\n    // 页面渲染完成\n\n  },\n  onShow: function () {\n    // 页面显示\n\n  },\n  onHide: function () {\n    // 页面隐藏\n\n  },\n  onUnload: function () {\n    // 页面关闭\n\n  }\n})"
  },
  {
    "path": "pages/brandDetail/brandDetail.json",
    "content": "{\n    \n}"
  },
  {
    "path": "pages/brandDetail/brandDetail.wxml",
    "content": "<view class=\"container\">\n    <view class=\"brand-info\">\n        <view class=\"name\">\n            <image class=\"img\" src=\"{{brand.app_list_pic_url}}\" background-size=\"cover\"></image>\n            <view class=\"info-box\">\n                <view class=\"info\">\n                    <text class=\"txt\">{{brand.name}}</text>\n                    <text class=\"line\"></text>\n                </view>\n            </view>\n        </view>\n        <view class=\"desc\">\n            {{brand.simple_desc}}\n        </view>\n    </view>\n\n    <view class=\"cate-item\">\n        <view class=\"b\">\n            <block wx:for=\"{{goodsList}}\" wx:for-index=\"iindex\" wx:for-item=\"iitem\">\n            <navigator class=\"item {{iindex % 2 == 0 ? 'item-b' : ''}}\" url=\"../goods/goods?id={{iitem.id}}\">\n                <image class=\"img\" src=\"{{iitem.list_pic_url}}\" background-size=\"cover\"></image>\n                <text class=\"name\">{{iitem.name}}</text>\n                <text class=\"price\">￥{{iitem.retail_price}}</text>\n            </navigator>\n            </block>\n        </view>\n    </view>\n</view>"
  },
  {
    "path": "pages/brandDetail/brandDetail.wxss",
    "content": "page{\n    background: #f4f4f4;\n}\n.brand-info .name{\n    width: 100%;\n    height: 290rpx;\n    position: relative;\n}\n\n.brand-info .img{\n    position: absolute;\n    top:0;\n    left:0;\n    width: 100%;\n    height: 290rpx;\n}\n\n.brand-info .info-box{\n    position: absolute;\n    top:0;\n    left:0;\n    width: 100%;\n    height: 290rpx;\n    text-align: center;\n    display: flex;\n    justify-content: center;\n    align-items: center;\n}\n\n.brand-info .info{\n    display: block;\n}\n\n.brand-info .txt{\n    display: block;\n    height: 37.5rpx;\n    font-size: 37.5rpx;\n    color: #fff;\n}\n\n.brand-info .line{\n    margin: 0 auto;\n    margin-top: 16rpx;\n    display: block;\n    height: 2rpx;\n    width: 145rpx;\n    background: #fff;\n}\n\n.brand-info .desc{\n    background: #fff;\n    width: 100%;\n    height: auto;\n    overflow: hidden;\n    padding: 41.5rpx 31.25rpx;\n    font-size: 30rpx;\n    color: #666;\n    line-height: 41.5rpx;\n    text-align: center;\n}\n\n.cate-item .b{\n  width: 750rpx;\n  height: auto;\n  overflow: hidden;\n  border-top: 1rpx solid #f4f4f4;\n  margin-top: 20rpx;\n}\n\n.cate-item .b .item{\n  float: left;\n  background: #fff;\n  width: 375rpx;\n  padding-bottom: 33.333rpx;\n  border-bottom: 1rpx solid #f4f4f4;\n  height: auto;\n  overflow: hidden;\n  text-align: center;\n}\n\n.cate-item .b .item-b{\n border-right: 1rpx solid #f4f4f4;\n}\n\n.cate-item .item .img{\n    margin-top: 10rpx;\n  width: 302rpx;\n  height: 302rpx;\n}\n\n.cate-item .item .name{\n  display: block;\n  width: 365.625rpx;\n  height: 35rpx;\n  padding: 0 20rpx;\n  overflow: hidden;\n  margin: 11.5rpx 0 22rpx 0;\n  text-align: center;\n  font-size: 30rpx;\n  color: #333;\n}\n\n.cate-item .item .price{\n  display: block;\n  width: 365.625rpx;\n  height: 30rpx;\n  text-align: center;\n  font-size: 30rpx;\n  color: #b4282d;\n}"
  },
  {
    "path": "pages/cart/cart.js",
    "content": "var util = require('../../utils/util.js');\nvar api = require('../../config/api.js');\n\nvar app = getApp();\n\nPage({\n  data: {\n    cartGoods: [],\n    cartTotal: {\n      \"goodsCount\": 0,\n      \"goodsAmount\": 0.00,\n      \"checkedGoodsCount\": 0,\n      \"checkedGoodsAmount\": 0.00\n    },\n    isEditCart: false,\n    checkedAllStatus: true,\n    editCartList: []\n  },\n  onLoad: function (options) {\n    // 页面初始化 options为页面跳转所带来的参数\n\n\n  },\n  onReady: function () {\n    // 页面渲染完成\n\n  },\n  onShow: function () {\n    // 页面显示\n    this.getCartList();\n  },\n  onHide: function () {\n    // 页面隐藏\n\n  },\n  onUnload: function () {\n    // 页面关闭\n\n  },\n  getCartList: function () {\n    let that = this;\n    util.request(api.CartList).then(function (res) {\n      if (res.errno === 0) {\n        console.log(res.data);\n        that.setData({\n          cartGoods: res.data.cartList,\n          cartTotal: res.data.cartTotal\n        });\n      }\n\n      that.setData({\n        checkedAllStatus: that.isCheckedAll()\n      });\n    });\n  },\n  isCheckedAll: function () {\n    //判断购物车商品已全选\n    return this.data.cartGoods.every(function (element, index, array) {\n      if (element.checked == true) {\n        return true;\n      } else {\n        return false;\n      }\n    });\n  },\n  checkedItem: function (event) {\n    let itemIndex = event.target.dataset.itemIndex;\n    let that = this;\n\n    if (!this.data.isEditCart) {\n      util.request(api.CartChecked, { productIds: that.data.cartGoods[itemIndex].product_id, isChecked: that.data.cartGoods[itemIndex].checked ? 0 : 1 }, 'POST').then(function (res) {\n        if (res.errno === 0) {\n          console.log(res.data);\n          that.setData({\n            cartGoods: res.data.cartList,\n            cartTotal: res.data.cartTotal\n          });\n        }\n\n        that.setData({\n          checkedAllStatus: that.isCheckedAll()\n        });\n      });\n    } else {\n      //编辑状态\n      let tmpCartData = this.data.cartGoods.map(function (element, index, array) {\n        if (index == itemIndex){\n          element.checked = !element.checked;\n        }\n        \n        return element;\n      });\n\n      that.setData({\n        cartGoods: tmpCartData,\n        checkedAllStatus: that.isCheckedAll(),\n        'cartTotal.checkedGoodsCount': that.getCheckedGoodsCount()\n      });\n    }\n  },\n  getCheckedGoodsCount: function(){\n    let checkedGoodsCount = 0;\n    this.data.cartGoods.forEach(function (v) {\n      if (v.checked === true) {\n        checkedGoodsCount += v.number;\n      }\n    });\n    console.log(checkedGoodsCount);\n    return checkedGoodsCount;\n  },\n  checkedAll: function () {\n    let that = this;\n\n    if (!this.data.isEditCart) {\n      var productIds = this.data.cartGoods.map(function (v) {\n        return v.product_id;\n      });\n      util.request(api.CartChecked, { productIds: productIds.join(','), isChecked: that.isCheckedAll() ? 0 : 1 }, 'POST').then(function (res) {\n        if (res.errno === 0) {\n          console.log(res.data);\n          that.setData({\n            cartGoods: res.data.cartList,\n            cartTotal: res.data.cartTotal\n          });\n        }\n\n        that.setData({\n          checkedAllStatus: that.isCheckedAll()\n        });\n      });\n    } else {\n      //编辑状态\n      let checkedAllStatus = that.isCheckedAll();\n      let tmpCartData = this.data.cartGoods.map(function (v) {\n        v.checked = !checkedAllStatus;\n        return v;\n      });\n\n      that.setData({\n        cartGoods: tmpCartData,\n        checkedAllStatus: that.isCheckedAll(),\n        'cartTotal.checkedGoodsCount': that.getCheckedGoodsCount()\n      });\n    }\n\n  },\n  editCart: function () {\n    var that = this;\n    if (this.data.isEditCart) {\n      this.getCartList();\n      this.setData({\n        isEditCart: !this.data.isEditCart\n      });\n    } else {\n      //编辑状态\n      let tmpCartList = this.data.cartGoods.map(function (v) {\n        v.checked = false;\n        return v;\n      });\n      this.setData({\n        editCartList: this.data.cartGoods,\n        cartGoods: tmpCartList,\n        isEditCart: !this.data.isEditCart,\n        checkedAllStatus: that.isCheckedAll(),\n        'cartTotal.checkedGoodsCount': that.getCheckedGoodsCount()\n      });\n    }\n\n  },\n  updateCart: function (productId, goodsId, number, id) {\n    let that = this;\n\n    util.request(api.CartUpdate, {\n      productId: productId,\n      goodsId: goodsId,\n      number: number,\n      id: id\n    }, 'POST').then(function (res) {\n      if (res.errno === 0) {\n        console.log(res.data);\n        that.setData({\n          //cartGoods: res.data.cartList,\n          //cartTotal: res.data.cartTotal\n        });\n      }\n\n      that.setData({\n        checkedAllStatus: that.isCheckedAll()\n      });\n    });\n\n  },\n  cutNumber: function (event) {\n\n    let itemIndex = event.target.dataset.itemIndex;\n    let cartItem = this.data.cartGoods[itemIndex];\n    let number = (cartItem.number - 1 > 1) ? cartItem.number - 1 : 1;\n    cartItem.number = number;\n    this.setData({\n      cartGoods: this.data.cartGoods\n    });\n    this.updateCart(cartItem.product_id, cartItem.goods_id, number, cartItem.id);\n  },\n  addNumber: function (event) {\n    let itemIndex = event.target.dataset.itemIndex;\n    let cartItem = this.data.cartGoods[itemIndex];\n    let number = cartItem.number + 1;\n    cartItem.number = number;\n    this.setData({\n      cartGoods: this.data.cartGoods\n    });\n    this.updateCart(cartItem.product_id, cartItem.goods_id, number, cartItem.id);\n\n  },\n  checkoutOrder: function () {\n    //获取已选择的商品\n    let that = this;\n\n    var checkedGoods = this.data.cartGoods.filter(function (element, index, array) {\n      if (element.checked == true) {\n        return true;\n      } else {\n        return false;\n      }\n    });\n\n    if (checkedGoods.length <= 0) {\n      return false;\n    }\n\n\n    wx.navigateTo({\n      url: '../shopping/checkout/checkout'\n    })\n  },\n  deleteCart: function () {\n    //获取已选择的商品\n    let that = this;\n\n    let productIds = this.data.cartGoods.filter(function (element, index, array) {\n      if (element.checked == true) {\n        return true;\n      } else {\n        return false;\n      }\n    });\n\n    if (productIds.length <= 0) {\n      return false;\n    }\n\n    productIds = productIds.map(function (element, index, array) {\n      if (element.checked == true) {\n        return element.product_id;\n      }\n    });\n\n\n    util.request(api.CartDelete, {\n      productIds: productIds.join(',')\n    }, 'POST').then(function (res) {\n      if (res.errno === 0) {\n        console.log(res.data);\n        let cartList = res.data.cartList.map(v => {\n          console.log(v);\n          v.checked = false;\n          return v;\n        });\n\n        that.setData({\n          cartGoods: cartList,\n          cartTotal: res.data.cartTotal\n        });\n      }\n\n      that.setData({\n        checkedAllStatus: that.isCheckedAll()\n      });\n    });\n  }\n})"
  },
  {
    "path": "pages/cart/cart.json",
    "content": "{\n    \"backgroundColor\": \"#f4f4f4\"\n}"
  },
  {
    "path": "pages/cart/cart.wxml",
    "content": "<view class=\"container\">\n  <view class=\"service-policy\">\n    <view class=\"item\">30天无忧退货</view>\n    <view class=\"item\">48小时快速退款</view>\n    <view class=\"item\">满88元免邮费</view>\n  </view>\n  <view class=\"no-cart\" wx:if=\"{{cartGoods.length <= 0}}\">\n    <view class=\"c\">\n      <image src=\"http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/noCart-a8fe3f12e5.png\" />\n      <text>去添加点什么吧</text>\n    </view>\n  </view>\n  <view class=\"cart-view\" wx:if=\"{{cartGoods.length > 0}}\">\n    <view class=\"list\">\n      <view class=\"group-item\">\n        <view class=\"goods\">\n          <view class=\"item {{isEditCart ? 'edit' : ''}}\" wx:for=\"{{cartGoods}}\" wx:key=\"{{item.id}}\">\n            <view class=\"checkbox {{item.checked ? 'checked' : ''}}\" bindtap=\"checkedItem\" data-item-index=\"{{index}}\"></view>\n            <view class=\"cart-goods\">\n              <image class=\"img\" src=\"{{item.list_pic_url}}\"></image>\n              <view class=\"info\">\n                <view class=\"t\">\n                  <text class=\"name\">{{item.goods_name}}</text>\n                  <text class=\"num\">x{{item.number}}</text>\n                </view>\n                <view class=\"attr\">{{ isEditCart ? '已选择:' : ''}}{{item.goods_specifition_name_value}}</view>\n                <view class=\"b\">\n                  <text class=\"price\">￥{{item.retail_price}}</text>\n                  <view class=\"selnum\">\n                    <view class=\"cut\" bindtap=\"cutNumber\" data-item-index=\"{{index}}\">-</view>\n                    <input value=\"{{item.number}}\" class=\"number\" disabled=\"true\" type=\"number\" />\n                    <view class=\"add\" bindtap=\"addNumber\" data-item-index=\"{{index}}\">+</view>\n                  </view>\n                </view>\n              </view>\n            </view>\n          </view>\n        </view>\n      </view>\n\n      <!--<view class=\"group-item\">\n                <view class=\"header\">\n                    <view class=\"promotion\">\n                        <text class=\"tag\">满赠</text>\n                        <text class=\"txt\">再加26元, 3件赠1件蔓越莓干</text>\n                        <image class=\"icon\" src=\"http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/go-b67cb9718d.png\"></image>\n                    </view>\n                    <view class=\"get\">领赠品</view>                \n                </view>\n                <view class=\"goods\">\n                    <view class=\"item\">\n                        <view class=\"checkbox\" ></view>\n                        <view class=\"cart-goods\">\n                            <image class=\"img\" src=\"http://yanxuan.nosdn.127.net/04e05e9de3a471b1f6479dd137b459a8.png\"></image>\n                            <view class=\"info\">\n                                <view class=\"t\">\n                                    <text class=\"name\">秋冬保暖加厚细羊毛被</text>\n                                    <text class=\"num\">x1</text>\n                                </view>\n                                <view class=\"attr\">220*240cm</view>\n                                <view class=\"b\">\n                                    <text class=\"price\">￥199.99</text>\n                                    <view class=\"open\">优惠活动</view>\n                                </view>\n                            </view>\n                        </view>\n                    </view>\n                </view>\n            </view>-->\n    </view>\n    <view class=\"cart-bottom\">\n      <view class=\"checkbox {{checkedAllStatus ? 'checked' : ''}}\" bindtap=\"checkedAll\">全选({{cartTotal.checkedGoodsCount}})</view>\n      <view class=\"total\">{{!isEditCart ? '￥'+cartTotal.checkedGoodsAmount : ''}}</view>\n      <view class=\"delete\" bindtap=\"editCart\">{{!isEditCart ? '编辑' : '完成'}}</view>\n      <view class=\"checkout\" bindtap=\"deleteCart\" wx:if=\"{{isEditCart}}\">删除所选</view>\n      <view class=\"checkout\" bindtap=\"checkoutOrder\" wx:if=\"{{!isEditCart}}\">下单</view>\n    </view>\n  </view>\n</view>"
  },
  {
    "path": "pages/cart/cart.wxss",
    "content": "page{\n    height: 100%;\n    min-height: 100%;\n    background: #f4f4f4;\n}\n.container{\n    background: #f4f4f4;\n    width: 100%;\n    height: auto;\n    min-height: 100%;\n    overflow: hidden;\n}\n.service-policy{\n    width: 750rpx;\n    height: 73rpx;\n    background: #f4f4f4;\n    padding: 0 31.25rpx;\n    display: flex;\n    flex-flow: row nowrap;\n    align-items: center;\n    justify-content: space-between;\n}\n\n.service-policy .item{\n    background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/servicePolicyRed-518d32d74b.png) 0 center no-repeat;\n    background-size: 10rpx;\n    padding-left: 15rpx;\n    display: flex;\n    align-items: center;\n    font-size: 25rpx;\n    color: #666;\n}\n\n.no-cart{\n    width: 100%;\n    height: auto;\n    margin: 0 auto;\n}\n\n.no-cart .c{\n    width: 100%;\n    height: auto;\n    margin-top: 200rpx;\n}\n\n.no-cart .c image{\n    margin: 0 auto;\n    display: block;\n    text-align: center;\n    width: 258rpx;\n    height: 258rpx;\n}\n\n.no-cart .c text{\n    margin: 0 auto;\n    display: block;\n    width: 258rpx;\n    height: 29rpx;\n    line-height: 29rpx;\n    text-align: center;\n    font-size: 29rpx;\n    color: #999;\n}\n\n\n.cart-view{\n    width: 100%;\n    height: auto;\n    overflow: hidden;\n    \n}\n\n.cart-view .list{\n    height: auto;\n    width: 100%;\n    overflow: hidden;\n    margin-bottom: 120rpx;\n}\n\n.cart-view .group-item{\n    height: auto;\n    width: 100%;\n    background: #fff;\n    margin-bottom: 18rpx;\n}\n\n.cart-view .item{\n    height: 164rpx;\n    width: 100%;\n    overflow: hidden;\n}\n.cart-view .item .checkbox{\n    float: left;\n    height: 34rpx;\n    width: 34rpx;\n    margin: 65rpx 18rpx 65rpx 26rpx;\n    background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/checkbox-0e09baa37e.png) no-repeat;\n    background-size: 34rpx;\n}\n\n.cart-view .item .checkbox.checked{\n    background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/checkbox-checked-822e54472a.png) no-repeat;\n    background-size: 34rpx;\n}\n\n.cart-view .item .cart-goods{\n    float: left;\n    height: 164rpx;\n    width: 672rpx;\n    border-bottom: 1px solid #f4f4f4;\n}\n\n.cart-view .item .img{\n    float: left;\n    height:125rpx;\n    width: 125rpx;\n    background: #f4f4f4;\n    margin: 19.5rpx 18rpx 19.5rpx 0;\n}\n\n.cart-view .item .info{\n    float: left;\n    height:125rpx;\n    width: 503rpx;\n    margin: 19.5rpx 26rpx 19.5rpx 0;\n}\n\n.cart-view .item .t{\n    margin: 8rpx 0;\n    height: 28rpx;\n    font-size: 25rpx;\n    color: #333;\n    overflow: hidden;\n}\n\n\n.cart-view .item .name{\n    height: 28rpx;\n    max-width: 310rpx;\n    line-height: 28rpx;\n    font-size: 25rpx;\n    color: #333;\n    overflow: hidden;\n}\n\n.cart-view .item .num{\n    height: 28rpx;\n    line-height: 28rpx;\n    float: right;\n}\n\n.cart-view .item .attr{\n    margin-bottom: 17rpx;\n    height: 24rpx;\n    line-height: 24rpx;\n    font-size: 22rpx;\n    color: #666;\n    overflow: hidden;\n}\n\n.cart-view .item .b{\n    height: 28rpx;\n    line-height: 28rpx;\n    font-size: 25rpx;\n    color: #333;\n    overflow: hidden;\n}\n\n.cart-view .item .price{\n    float: left;\n}\n\n.cart-view .item .open{\n    height: 28rpx;\n    width: 150rpx;\n    display: block;\n    float: right;\n    background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/arrowDown-d48093db25.png) right center no-repeat;\n    background-size: 25rpx;\n    font-size: 25rpx;\n    color: #333;\n}\n\n.cart-view .item.edit .t{\n    display: none;\n}\n\n.cart-view .item.edit .attr{\n    text-align: right;\n    background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/arrow-right1-e9828c5b35.png) right center no-repeat;\n    padding-right: 25rpx;\n    background-size: 12rpx 20rpx;\n    margin-bottom: 24rpx;\n    height: 39rpx;\n    line-height: 39rpx;\n    font-size: 24rpx;\n    color: #999;\n    overflow: hidden;\n}\n\n.cart-view .item.edit .b{\n    display: flex;\n    height: 52rpx;\n    overflow: hidden;\n}\n\n.cart-view .item.edit .price{\n    line-height: 52rpx;\n    height: 52rpx;\n    flex: 1;\n}\n\n.cart-view .item .selnum{\n    display: none;\n}\n\n.cart-view .item.edit .selnum{\n    width: 235rpx;\n    height: 52rpx;\n    border: 1rpx solid #ccc;\n    display: flex;\n}\n\n.selnum .cut{\n    width: 70rpx;\n    height: 100%;\n    text-align: center;\n    line-height: 50rpx;\n}\n\n.selnum .number{\n    flex: 1;\n    height: 100%;\n    text-align: center;\n    line-height: 68.75rpx;\n    border-left: 1px solid #ccc;\n    border-right: 1px solid #ccc;\n    float: left;\n}\n\n.selnum .add{\n    width: 80rpx;\n    height: 100%;\n    text-align: center;\n    line-height: 50rpx;\n}\n\n\n.cart-view .group-item .header{\n    width: 100%;\n    height: 94rpx;\n    line-height: 94rpx;\n    padding: 0 26rpx;\n    border-bottom: 1px solid #f4f4f4;\n}\n\n.cart-view .promotion .icon{\n    display: inline-block;\n    height: 24rpx;\n    width: 15rpx;\n}\n\n.cart-view .promotion{\n    margin-top: 25.5rpx;\n    float: left;\n    height: 43rpx;\n    width: 480rpx;\n    /*margin-right: 84rpx;*/\n    line-height: 43rpx;\n    font-size: 0;\n}\n\n.cart-view .promotion .tag{\n    border: 1px solid #f48f18;\n    height: 37rpx;\n    line-height: 31rpx;\n    padding: 0 9rpx;\n    margin-right: 10rpx;\n    color: #f48f18;\n    font-size: 24.5rpx;\n}\n\n.cart-view .promotion .txt{\n    height: 43rpx;\n    line-height: 43rpx;\n    padding-right: 10rpx;\n    color: #333;\n    font-size: 29rpx;\n    overflow: hidden;\n}\n\n.cart-view .get{\n    margin-top: 18rpx;\n    float: right;\n    height: 58rpx;\n    padding-left: 14rpx;\n    border-left: 1px solid #d9d9d9;\n    line-height: 58rpx;\n    font-size: 29rpx;\n    color: #333;\n}\n\n.cart-bottom{\n    position: fixed;\n    bottom:0;\n    left:0;\n    height: 100rpx;\n    width: 100%;\n    background: #fff;\n    display: flex;\n}\n\n.cart-bottom .checkbox{\n    height: 34rpx;\n\n    padding-left: 60rpx;\n    line-height: 34rpx;\n    margin: 33rpx 18rpx 33rpx 26rpx;\n    background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/checkbox-0e09baa37e.png) no-repeat;\n    background-size: 34rpx;\n    font-size: 29rpx;\n}\n\n.cart-bottom .checkbox.checked{\n    background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/checkbox-checked-822e54472a.png) no-repeat;\n    background-size: 34rpx;\n}\n\n.cart-bottom .total{\n    height: 34rpx;\n    flex: 1;\n    margin: 33rpx 10rpx;\n    font-size: 29rpx;\n}\n\n\n.cart-bottom .delete{\n    height: 34rpx;\n    width: auto;\n    margin: 33rpx 18rpx;\n    font-size: 29rpx;\n}\n\n.cart-bottom .checkout{\n    height: 100rpx;\n    width: 210rpx;\n    text-align: center;\n    line-height: 100rpx;\n    font-size: 29rpx;\n    background: #b4282d;\n    color: #fff;\n}"
  },
  {
    "path": "pages/catalog/catalog.js",
    "content": "var util = require('../../utils/util.js');\nvar api = require('../../config/api.js');\n\nPage({\n  data: {\n    navList: [],\n    categoryList: [],\n    currentCategory: {},\n    scrollLeft: 0,\n    scrollTop: 0,\n    goodsCount: 0,\n    scrollHeight: 0\n  },\n  onLoad: function (options) {\n    this.getCatalog();\n  },\n  getCatalog: function () {\n    //CatalogList\n    let that = this;\n    wx.showLoading({\n      title: '加载中...',\n    });\n    util.request(api.CatalogList).then(function (res) {\n        that.setData({\n          navList: res.data.categoryList,\n          currentCategory: res.data.currentCategory\n        });\n        wx.hideLoading();\n      });\n    util.request(api.GoodsCount).then(function (res) {\n      that.setData({\n        goodsCount: res.data.goodsCount\n      });\n    });\n\n  },\n  getCurrentCategory: function (id) {\n    let that = this;\n    util.request(api.CatalogCurrent, { id: id })\n      .then(function (res) {\n        that.setData({\n          currentCategory: res.data.currentCategory\n        });\n      });\n  },\n  onReady: function () {\n    // 页面渲染完成\n  },\n  onShow: function () {\n    // 页面显示\n  },\n  onHide: function () {\n    // 页面隐藏\n  },\n  onUnload: function () {\n    // 页面关闭\n  },\n  getList: function () {\n    var that = this;\n    util.request(api.ApiRootUrl + 'api/catalog/' + that.data.currentCategory.cat_id)\n      .then(function (res) {\n        that.setData({\n          categoryList: res.data,\n        });\n      });\n  },\n  switchCate: function (event) {\n    var that = this;\n    var currentTarget = event.currentTarget;\n    if (this.data.currentCategory.id == event.currentTarget.dataset.id) {\n      return false;\n    }\n\n    this.getCurrentCategory(event.currentTarget.dataset.id);\n  }\n})"
  },
  {
    "path": "pages/catalog/catalog.json",
    "content": "{}"
  },
  {
    "path": "pages/catalog/catalog.wxml",
    "content": "<view class=\"container\">\n  <view class=\"search\">\n    <navigator url=\"/pages/search/search\" class=\"input\">\n      <image class=\"icon\"></image>\n      <text class=\"txt\">商品搜索, 共{{goodsCount}}款好物</text>\n    </navigator>\n  </view>\n  <view class=\"catalog\">\n    <scroll-view class=\"nav\" scroll-y=\"true\">\n        <view class=\"item {{ currentCategory.id == item.id ? 'active' : ''}}\" wx:for=\"{{navList}}\"  data-id=\"{{item.id}}\" data-index=\"{{index}}\" bindtap=\"switchCate\">{{item.name}}</view>\n    </scroll-view>\n    <scroll-view class=\"cate\" scroll-y=\"true\">\n        <navigator url=\"url\" class=\"banner\">\n            <image class=\"image\" src=\"{{currentCategory.wap_banner_url}}\"></image>\n            <view class=\"txt\">{{currentCategory.front_name}}</view>\n        </navigator>\n        <view class=\"hd\">\n            <text class=\"line\"></text>\n            <text class=\"txt\">{{currentCategory.name}}分类</text>\n            <text class=\"line\"></text>\n        </view>\n        <view class=\"bd\">\n            <navigator url=\"/pages/category/category?id={{item.id}}\" class=\"item {{(index+1) % 3 == 0 ? 'last' : ''}}\" wx:for=\"{{currentCategory.subCategoryList}}\">\n                <image class=\"icon\" src=\"{{item.wap_banner_url}}\"></image>\n                <text class=\"txt\">{{item.name}}</text>\n            </navigator>\n        </view>\n    </scroll-view>\n  </view>\n</view>"
  },
  {
    "path": "pages/catalog/catalog.wxss",
    "content": "page {\n  height: 100%;\n}\n\n.container {\n  background: #f9f9f9;\n  height: 100%;\n  width: 100%;\n  display: flex;\n  flex-direction: column;\n}\n\n.search {\n  height: 88rpx;\n  width: 100%;\n  padding: 0 30rpx;\n  background: #fff;\n  display: flex;\n  align-items: center;\n}\n\n.search .input {\n  width: 690rpx;\n  height: 56rpx;\n  background: #ededed;\n  border-radius: 8rpx;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n.search .icon {\n  background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/search2-2fb94833aa.png) center no-repeat;\n  background-size: 100%;\n  width: 28rpx;\n  height: 28rpx;\n}\n\n.search .txt {\n  height: 42rpx;\n  line-height: 42rpx;\n  color: #666;\n  padding-left: 10rpx;\n  font-size: 30rpx;\n}\n\n.catalog {\n  flex: 1;\n  width: 100%;\n  background: #fff;\n  display: flex;\n  border-top: 1px solid #fafafa;\n}\n\n.catalog .nav {\n  width: 162rpx;\n  height: 100%;\n}\n\n.catalog .nav .item {\n  text-align: center;\n  line-height: 90rpx;\n  width: 162rpx;\n  height: 90rpx;\n  color: #333;\n  font-size: 28rpx;\n  border-left: 6rpx solid #fff;\n}\n\n.catalog .nav .item.active {\n  color: #ab2b2b;\n  font-size: 36rpx;\n  border-left: 6rpx solid #ab2b2b;\n}\n\n.catalog .cate {\n  border-left: 1px solid #fafafa;\n  flex: 1;\n  height: 100%;\n  padding: 0 30rpx 0 30rpx;\n}\n\n.banner {\n  display: block;\n  height: 222rpx;\n  width: 100%;\n  position: relative;\n}\n\n.banner .image {\n  position: absolute;\n  top: 30rpx;\n  left: 0;\n  border-radius: 4rpx;\n  height: 192rpx;\n  width: 100%;\n}\n\n.banner .txt {\n  position: absolute;\n  top: 30rpx;\n  text-align: center;\n  color: #fff;\n  font-size: 28rpx;\n  left: 0;\n  height: 192rpx;\n  line-height: 192rpx;\n  width: 100%;\n}\n\n.catalog .hd {\n  height: 108rpx;\n  width: 100%;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n}\n\n.catalog .hd .txt {\n  font-size: 24rpx;\n  text-align: center;\n  color: #333;\n  padding: 0 10rpx;\n  width: auto;\n}\n\n.catalog .hd .line {\n  width: 40rpx;\n  height: 1px;\n  background: #d9d9d9;\n}\n\n.catalog .bd {\n  height: auto;\n  width: 100%;\n  overflow: hidden;\n}\n\n.catalog .bd .item {\n  display: block;\n  float: left;\n  height: 216rpx;\n  width: 144rpx;\n  margin-right: 34rpx;\n}\n\n.catalog .bd .item.last {\n  margin-right: 0;\n}\n\n.catalog .bd .item .icon {\n  height: 144rpx;\n  width: 144rpx;\n}\n\n.catalog .bd .item .txt {\n  display: block;\n  text-align: center;\n  font-size: 24rpx;\n  color: #333;\n  height: 72rpx;\n  width: 144rpx;\n}\n"
  },
  {
    "path": "pages/category/category.js",
    "content": "var util = require('../../utils/util.js');\nvar api = require('../../config/api.js');\n\nPage({\n  data: {\n    // text:\"这是一个页面\"\n    navList: [],\n    goodsList: [],\n    id: 0,\n    currentCategory: {},\n    scrollLeft: 0,\n    scrollTop: 0,\n    scrollHeight: 0,\n    page: 1,\n    size: 10000\n  },\n  onLoad: function (options) {\n    // 页面初始化 options为页面跳转所带来的参数\n    var that = this;\n    if (options.id) {\n      that.setData({\n        id: parseInt(options.id)\n      });\n    }\n\n    wx.getSystemInfo({\n      success: function (res) {\n        that.setData({\n          scrollHeight: res.windowHeight\n        });\n      }\n    });\n\n\n    this.getCategoryInfo();\n\n  },\n  getCategoryInfo: function () {\n    let that = this;\n    util.request(api.GoodsCategory, { id: this.data.id })\n      .then(function (res) {\n\n        if (res.errno == 0) {\n          that.setData({\n            navList: res.data.brotherCategory,\n            currentCategory: res.data.currentCategory\n          });\n\n          //nav位置\n          let currentIndex = 0;\n          let navListCount = that.data.navList.length;\n          for (let i = 0; i < navListCount; i++) {\n            currentIndex += 1;\n            if (that.data.navList[i].id == that.data.id) {\n              break;\n            }\n          }\n          if (currentIndex > navListCount / 2 && navListCount > 5) {\n            that.setData({\n              scrollLeft: currentIndex * 60\n            });\n          }\n          that.getGoodsList();\n\n        } else {\n          //显示错误信息\n        }\n        \n      });\n  },\n  onReady: function () {\n    // 页面渲染完成\n  },\n  onShow: function () {\n    // 页面显示\n    console.log(1);\n  },\n  onHide: function () {\n    // 页面隐藏\n  },\n  getGoodsList: function () {\n    var that = this;\n\n    util.request(api.GoodsList, {categoryId: that.data.id, page: that.data.page, size: that.data.size})\n      .then(function (res) {\n        that.setData({\n          goodsList: res.data.goodsList,\n        });\n      });\n  },\n  onUnload: function () {\n    // 页面关闭\n  },\n  switchCate: function (event) {\n    if (this.data.id == event.currentTarget.dataset.id) {\n      return false;\n    }\n    var that = this;\n    var clientX = event.detail.x;\n    var currentTarget = event.currentTarget;\n    if (clientX < 60) {\n      that.setData({\n        scrollLeft: currentTarget.offsetLeft - 60\n      });\n    } else if (clientX > 330) {\n      that.setData({\n        scrollLeft: currentTarget.offsetLeft\n      });\n    }\n    this.setData({\n      id: event.currentTarget.dataset.id\n    });\n\n    this.getCategoryInfo();\n  }\n})"
  },
  {
    "path": "pages/category/category.json",
    "content": "{}"
  },
  {
    "path": "pages/category/category.wxml",
    "content": "<view class=\"container\">\n    <view class=\"cate-nav\">\n        <scroll-view scroll-x=\"true\" class=\"cate-nav-body\" style=\"width: 750rpx;\" scroll-left=\"{{scrollLeft}}\">\n            <view  wx:for=\"{{navList}}\" class=\"item {{ id == item.id ? 'active' : ''}}\" data-id=\"{{item.id}}\" data-index=\"{{index}}\" bindtap=\"switchCate\">\n                <view class=\"name\">{{item.name}}</view>\n            </view>\n        </scroll-view>\n    </view>\n    <scroll-view scroll-y=\"true\" scroll-top=\"{{scrollTop}}\" style=\"height:{{scrollHeight}};\">\n\n    <view class=\"cate-item\">\n        <view class=\"h\">\n            <text class=\"name\">{{currentCategory.name}}</text>\n            <text class=\"desc\">{{currentCategory.front_name}}</text>\n        </view>\n        <view class=\"b\">\n            <navigator class=\"item {{(iindex + 1) % 2 == 0 ? 'item-b' : ''}}\"   url=\"/pages/goods/goods?id={{iitem.id}}\" wx:for=\"{{goodsList}}\" wx:for-item=\"iitem\" wx:for-index=\"iindex\" >\n                <image class=\"img\" src=\"{{iitem.list_pic_url}}\" background-size=\"cover\"></image>\n                <text class=\"name\">{{iitem.name}}</text>\n                <text class=\"price\">￥{{iitem.retail_price}}</text>\n            </navigator>\n        </view>\n    </view>\n    </scroll-view>\n</view>"
  },
  {
    "path": "pages/category/category.wxss",
    "content": ".container{\n    background: #f9f9f9;\n}\n.cate-nav{\n    position: fixed;\n    left:0;\n    top:0;\n    z-index: 1000;\n}\n\n.cate-nav-body{\n    height: 84rpx;\n    white-space: nowrap;   \n    background: #fff;\n    border-top: 1px solid rgba(0,0,0,.15);\n    overflow: hidden;\n}\n\n.cate-nav .item{\n    display: inline-block;\n    height: 84rpx;\n    min-width: 130rpx;\n    padding: 0 15rpx;\n}\n\n.cate-nav .item .name{\n    display: block;\n    height: 84rpx;\n    padding: 0 20rpx;\n    line-height: 84rpx;\n    color: #333;\n    font-size: 30rpx;\n    width: auto;\n}\n\n.cate-nav .item.active .name{\n    color: #ab2b2b;\n    border-bottom: 2px solid #ab2b2b;\n}\n\n.cate-item{\n    margin-top: 94rpx;\n    height: auto;\n    overflow: hidden;\n}\n\n.cate-item .h{\n    height: 145rpx;\n    width: 750rpx;\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n}\n\n.cate-item .h .name{\n    display: block;\n    height: 35rpx;\n    margin-bottom: 18rpx;\n    font-size: 30rpx;\n    color: #333;\n}\n\n.cate-item .h .desc{\n    display: block;\n    height: 24rpx;\n    font-size: 24rpx;\n    color: #999;\n}\n\n.cate-item .b{\n  width: 750rpx;\n  padding: 0 6.25rpx;\n  height: auto;\n  overflow: hidden;\n}\n\n.cate-item .b .item{\n  float: left;\n  background: #fff;\n  width: 365rpx;\n  margin-bottom: 6.25rpx;\n  padding-bottom: 33.333rpx;\n  height: auto;\n  overflow: hidden;\n  text-align: center;\n}\n\n.cate-item .b .item-b{\n  margin-left: 6.25rpx;\n}\n\n.cate-item .item .img{\n  width: 302rpx;\n  height: 302rpx;\n}\n\n.cate-item .item .name{\n  display: block;\n  width: 365.625rpx;\n  height: 35rpx;\n  margin: 11.5rpx 0 22rpx 0;\n  text-align: center;\n  overflow: hidden;\n  padding: 0 20rpx;\n  font-size: 30rpx;\n  color: #333;\n}\n\n.cate-item .item .price{\n  display: block;\n  width: 365.625rpx;\n  height: 30rpx;\n  text-align: center;\n  font-size: 30rpx;\n  color: #b4282d;\n}"
  },
  {
    "path": "pages/comment/comment.js",
    "content": "var app = getApp();\nvar util = require('../../utils/util.js');\nvar api = require('../../config/api.js');\n\nPage({\n  data: {\n    comments: [],\n    allCommentList: [],\n    picCommentList: [],\n    typeId: 0,\n    valueId: 0,\n    showType: 0,\n    allCount: 0,\n    hasPicCount: 0,\n    allPage: 1,\n    picPage: 1,\n    size: 20\n  },\n  getCommentCount: function () {\n    let that = this;\n    util.request(api.CommentCount, { valueId: that.data.valueId, typeId: that.data.typeId}).then(function (res) {\n      if (res.errno === 0) {\n\n        that.setData({\n          allCount: res.data.allCount,\n          hasPicCount: res.data.hasPicCount\n        });\n      }\n    });\n  },\n  getCommentList: function(){\n    let that = this;\n    util.request(api.CommentList, { \n      valueId: that.data.valueId, \n      typeId: that.data.typeId, \n      size: that.data.size,\n      page: (that.data.showType == 0 ? that.data.allPage : that.data.picPage),\n      showType: that.data.showType \n      }).then(function (res) {\n      if (res.errno === 0) {\n\n        if (that.data.showType == 0) {\n          that.setData({\n            allCommentList: that.data.allCommentList.concat(res.data.data),\n            allPage: res.data.currentPage,\n            comments: that.data.allCommentList.concat(res.data.data)\n          });\n        } else {\n          that.setData({\n            picCommentList: that.data.picCommentList.concat(res.data.data),\n            picPage: res.data.currentPage,\n            comments: that.data.picCommentList.concat(res.data.data)\n          });\n        }\n      }\n    });\n  },\n  onLoad: function (options) {\n    // 页面初始化 options为页面跳转所带来的参数\n    this.setData({\n      typeId: options.typeId,\n      valueId: options.valueId\n    });\n    this.getCommentCount();\n    this.getCommentList();\n  },\n  onReady: function () {\n    // 页面渲染完成\n\n  },\n  onShow: function () {\n    // 页面显示\n\n  },\n  onHide: function () {\n    // 页面隐藏\n\n  },\n  onUnload: function () {\n    // 页面关闭\n\n  },\n  switchTab: function () {\n    this.setData({\n      showType: this.data.showType == 1 ? 0 :1\n    });\n\n    this.getCommentList();\n  },\n  onReachBottom: function(){\n    console.log('onPullDownRefresh');\n    if ( this.data.showType == 0) {\n\n      if (this.data.allCount / this.data.size < this.data.allPage) {\n        return false;\n      }\n\n      this.setData({\n        'allPage' : this.data.allPage + 1\n      });\n    } else {\n      if (this.data.hasPicCount / this.data.size < this.data.picPage) {\n        return false;\n      }\n\n      this.setData({\n        'picPage': this.data.picPage + 1\n      });\n    }\n\n\n\n    this.getCommentList();\n  }\n})"
  },
  {
    "path": "pages/comment/comment.json",
    "content": "{\n\n}"
  },
  {
    "path": "pages/comment/comment.wxml",
    "content": "<view class=\"comments\">\n    <view class=\"h\">\n        <view class=\"item {{ showType == 0 ? 'active' : ''}}\" bindtap=\"switchTab\">\n            <view class=\"txt\">全部({{allCount}})</view>\n        </view>\n        <view class=\"item {{ showType == 0 ? '' : 'active'}}\" bindtap=\"switchTab\">\n            <view class=\"txt\">有图({{hasPicCount}})</view>\n        </view>\n    </view>\n  <view class=\"b\">\n    <view class=\"item\" wx:for=\"{{comments}}\" wx:key=\"{{item.id}}\">\n      <view class=\"info\">\n        <view class=\"user\">\n          <image src=\"{{item.user_info.avatar}}\"></image>\n          <text>{{item.user_info.nickname}}</text>\n        </view>\n        <view class=\"time\">{{item.add_time}}</view>\n      </view>\n      <view class=\"comment\">{{item.content}}</view>\n      <view class=\"imgs\" wx:if=\"{{item.pic_list.length > 0}}\">\n        <image class=\"img\" wx:for=\"{{item.pic_list}}\" wx:key=\"{{pitem.id}}\" wx:for-item=\"pitem\" src=\"{{pitem.pic_url}}\"></image>\n      </view>\n      <view class=\"spec\">\n        <!-- <text class=\"item\">白色 2件</text> -->\n      </view>\n      <!--<view class=\"customer-service\" wx:if=\"{{item.commentReplyVO}}\">\n        <text class=\"u\">小选回复：</text>\n        <text class=\"c\">{{item.commentReplyVO.replyContent}}</text>\n      </view>-->\n    </view>\n\n  </view>\n</view>"
  },
  {
    "path": "pages/comment/comment.wxss",
    "content": ".comments{\n    width: 100%;\n    height: auto;\n    padding-left:30rpx;\n    background: #fff;\n    margin: 20rpx 0;\n}\n\n.comments .h{\n    position: fixed;\n    left:0;\n    top:0;\n    z-index: 1000;\n    width: 100%;\n    display: flex;   \n    background: #fff;\n    height: 84rpx;\n    border-bottom: 1px solid rgba(0,0,0,.15);\n}\n\n.comments .h .item{\n    display: inline-block;\n    height: 82rpx;\n    width: 50%;\n    padding: 0 15rpx;\n    text-align: center;\n}\n\n.comments .h .item .txt{\n    display: inline-block;\n    height: 82rpx;\n    padding: 0 20rpx;\n    line-height: 82rpx;\n    color: #333;\n    font-size: 30rpx;\n    width: 170rpx;\n}\n\n.comments .h .item.active .txt{\n    color: #ab2b2b;\n    border-bottom: 4rpx solid #ab2b2b;\n}\n\n.comments .b{\n    margin-top: 85rpx;\n    height: auto;\n    width: 720rpx;\n}\n\n.comments .b.no-h{\n    margin-top: 0;\n}\n\n.comments .item{\n    height: auto;\n    width: 720rpx;\n    overflow: hidden;\n    border-bottom: 1px solid #d9d9d9;\n    padding-bottom: 25rpx;\n}\n\n.comments .info{\n    height: 127rpx;\n    width: 100%;\n    padding: 33rpx 0 27rpx 0;\n}\n\n.comments .user{\n    float: left;\n    width: auto;\n    height: 67rpx;\n    line-height: 67rpx;\n    font-size: 0;\n}\n\n.comments .user image{\n    float: left;\n    width: 67rpx;\n    height: 67rpx;\n    margin-right: 17rpx;\n    border-radius: 50%;\n}\n\n.comments .user text{\n    display: inline-block;\n    width: auto;\n    height: 66rpx;\n    overflow: hidden;\n    font-size: 29rpx;\n    line-height: 66rpx;\n}\n\n.comments .time{\n    display: block;\n    float: right;\n    width: auto;\n    height: 67rpx;\n    line-height: 67rpx;\n    color: #7f7f7f;\n    font-size: 25rpx;\n    margin-right: 30rpx;\n}\n\n.comments .comment{\n    width: 720rpx;\n    padding-right: 30rpx;\n    line-height: 45.8rpx;\n    font-size: 29rpx;\n    margin-bottom: 16rpx;\n}\n\n.comments .imgs{\n    width: 720rpx;\n    height: 150rpx;\n    margin-bottom: 25rpx;\n}\n\n.comments .imgs .img{\n    height: 150rpx;\n    width: 150rpx;\n    margin-right: 28rpx;\n}\n\n.comments .spec{\n    width: 720rpx;\n    height: 25rpx;\n    font-size: 24rpx;\n    color: #999;\n}\n\n.comments .spec .item{\n    color: #7f7f7f;\n    font-size: 25rpx;\n}\n\n.comments .customer-service{\n    width: 690rpx;\n    height: auto;\n    overflow: hidden;\n    margin-top: 23rpx;\n    background: rgba(0,0,0,.03);\n    padding: 21rpx;\n}\n\n\n.comments .customer-service .u{\n    font-size: 24rpx;\n    color: #333;\n    line-height: 37.5rpx;\n}\n\n.comments .customer-service .c{\n    font-size: 24rpx;\n    color: #999;\n    line-height: 37.5rpx;\n}"
  },
  {
    "path": "pages/commentPost/commentPost.js",
    "content": "var app = getApp();\nvar util = require('../../utils/util.js');\nvar api = require('../../config/api.js');\nPage({\n  data: {\n    typeId: 0,\n    valueId: 0,\n    content: ''\n  },\n  onLoad: function (options) {\n\n    var that = this;\n    that.setData({\n      typeId: parseInt(options.typeId),\n      valueId: parseInt(options.valueId)\n    });\n\n  },\n  onClose() {\n    wx.navigateBack({\n      delta: 1\n    });\n  },\n  onPost() {\n    let that = this;\n\n    if (!this.data.content) {\n      util.showErrorToast('请填写评论')\n      return false;\n    }\n\n\n    util.request(api.CommentPost, {\n      typeId: that.data.typeId,\n      valueId: that.data.valueId,\n      content: that.data.content\n    }, 'POST').then(function (res) {\n      if (res.errno === 0) {\n        wx.showToast({\n          title: '评论成功',\n          complete: function(){\n            wx.navigateBack({\n              delta: 1\n            });\n          }\n        })\n      }\n      console.log(res)\n    });\n  },\n  bindInpuntValue(event){\n\n    let value = event.detail.value;\n\n    //判断是否超过140个字符\n    if (value && value.length > 140) {\n      return false;\n    }\n\n    this.setData({\n      content: event.detail.value,\n    })\n    console.log(event.detail)\n  },\n  onReady: function () {\n\n  },\n  onShow: function () {\n    // 页面显示\n\n  },\n  onHide: function () {\n    // 页面隐藏\n\n  },\n  onUnload: function () {\n    // 页面关闭\n\n  }\n})"
  },
  {
    "path": "pages/commentPost/commentPost.json",
    "content": "{\n  \"navigationBarTitleText\": \"填写留言\"\n}"
  },
  {
    "path": "pages/commentPost/commentPost.wxml",
    "content": "<view class=\"container\">\n  <view class=\"post-comment\">\n        <view class=\"input-box\">\n            <textarea class=\"content\" focus=\"true\" bindinput=\"bindInpuntValue\" maxlength=\"140\" placeholder=\"留言经过筛选后，对所有人可见\" />\n            <text class=\"count\">{{140 - content.length}}</text>\n        </view>\n        <view class=\"btns\">\n            <view class=\"close\" bindtap=\"onClose\">取消</view>\n            <view class=\"post\" bindtap=\"onPost\">发表</view>\n        </view>\n    </view>\n</view>"
  },
  {
    "path": "pages/commentPost/commentPost.wxss",
    "content": "page, .container {\n  height: 100%;\n  background: #f4f4f4;\n}\n\n.post-comment {\n  width: 750rpx;\n  height: auto;\n  overflow: hidden;\n  padding: 30rpx;\n}\n\n.post-comment .input-box {\n  height: 337.5rpx;\n  width: 690rpx;\n  position: relative;\n  background: #fff;\n}\n\n.post-comment .input-box .content {\n  position: absolute;\n  top: 0;\n  left: 0;\n  display: block;\n  background: #fff;\n  font-size: 29rpx;\n  color: #333;\n  height: 300rpx;\n  width: 650rpx;\n  padding: 20rpx;\n}\n\n.post-comment .input-box .count {\n  position: absolute;\n  bottom: 20rpx;\n  right: 20rpx;\n  display: block;\n  height: 30rpx;\n  width: 50rpx;\n  font-size: 29rpx;\n  color: #999;\n}\n\n.post-comment .btns {\n  height: 108rpx;\n}\n\n.post-comment .close {\n  float: left;\n  height: 108rpx;\n  line-height: 108rpx;\n  text-align: left;\n  color: #666;\n  padding: 0 30rpx;\n}\n\n.post-comment .post {\n  float: right;\n  height: 108rpx;\n  line-height: 108rpx;\n  text-align: right;\n  padding: 0 30rpx;\n}\n"
  },
  {
    "path": "pages/goods/goods.js",
    "content": "var app = getApp();\nvar WxParse = require('../../lib/wxParse/wxParse.js');\nvar util = require('../../utils/util.js');\nvar api = require('../../config/api.js');\n\nPage({\n  data: {\n    id: 0,\n    goods: {},\n    gallery: [],\n    attribute: [],\n    issueList: [],\n    comment: [],\n    brand: {},\n    specificationList: [],\n    productList: [],\n    relatedGoods: [],\n    cartGoodsCount: 0,\n    userHasCollect: 0,\n    number: 1,\n    checkedSpecText: '请选择规格数量',\n    openAttr: false,\n    noCollectImage: \"/static/images/icon_collect.png\",\n    hasCollectImage: \"/static/images/icon_collect_checked.png\",\n    collectBackImage: \"/static/images/icon_collect.png\"\n  },\n  getGoodsInfo: function () {\n    let that = this;\n    util.request(api.GoodsDetail, { id: that.data.id }).then(function (res) {\n      if (res.errno === 0) {\n        that.setData({\n          goods: res.data.info,\n          gallery: res.data.gallery,\n          attribute: res.data.attribute,\n          issueList: res.data.issue,\n          comment: res.data.comment,\n          brand: res.data.brand,\n          specificationList: res.data.specificationList,\n          productList: res.data.productList,\n          userHasCollect: res.data.userHasCollect\n        });\n\n        if (res.data.userHasCollect == 1) {\n          that.setData({\n            'collectBackImage': that.data.hasCollectImage\n          });\n        } else {\n          that.setData({\n            'collectBackImage': that.data.noCollectImage\n          });\n        }\n\n        WxParse.wxParse('goodsDetail', 'html', res.data.info.goods_desc, that);\n\n        that.getGoodsRelated();\n      }\n    });\n\n  },\n  getGoodsRelated: function () {\n    let that = this;\n    util.request(api.GoodsRelated, { id: that.data.id }).then(function (res) {\n      if (res.errno === 0) {\n        that.setData({\n          relatedGoods: res.data.goodsList,\n        });\n      }\n    });\n\n  },\n  clickSkuValue: function (event) {\n    let that = this;\n    let specNameId = event.currentTarget.dataset.nameId;\n    let specValueId = event.currentTarget.dataset.valueId;\n\n    //判断是否可以点击\n\n    //TODO 性能优化，可在wx:for中添加index，可以直接获取点击的属性名和属性值，不用循环\n    let _specificationList = this.data.specificationList;\n    for (let i = 0; i < _specificationList.length; i++) {\n      if (_specificationList[i].specification_id == specNameId) {\n        for (let j = 0; j < _specificationList[i].valueList.length; j++) {\n          if (_specificationList[i].valueList[j].id == specValueId) {\n            //如果已经选中，则反选\n            if (_specificationList[i].valueList[j].checked) {\n              _specificationList[i].valueList[j].checked = false;\n            } else {\n              _specificationList[i].valueList[j].checked = true;\n            }\n          } else {\n            _specificationList[i].valueList[j].checked = false;\n          }\n        }\n      }\n    }\n    this.setData({\n      'specificationList': _specificationList\n    });\n    //重新计算spec改变后的信息\n    this.changeSpecInfo();\n\n    //重新计算哪些值不可以点击\n  },\n\n  //获取选中的规格信息\n  getCheckedSpecValue: function () {\n    let checkedValues = [];\n    let _specificationList = this.data.specificationList;\n    for (let i = 0; i < _specificationList.length; i++) {\n      let _checkedObj = {\n        nameId: _specificationList[i].specification_id,\n        valueId: 0,\n        valueText: ''\n      };\n      for (let j = 0; j < _specificationList[i].valueList.length; j++) {\n        if (_specificationList[i].valueList[j].checked) {\n          _checkedObj.valueId = _specificationList[i].valueList[j].id;\n          _checkedObj.valueText = _specificationList[i].valueList[j].value;\n        }\n      }\n      checkedValues.push(_checkedObj);\n    }\n\n    return checkedValues;\n\n  },\n  //根据已选的值，计算其它值的状态\n  setSpecValueStatus: function () {\n\n  },\n  //判断规格是否选择完整\n  isCheckedAllSpec: function () {\n    return !this.getCheckedSpecValue().some(function (v) {\n      if (v.valueId == 0) {\n        return true;\n      }\n    });\n  },\n  getCheckedSpecKey: function () {\n    let checkedValue = this.getCheckedSpecValue().map(function (v) {\n      return v.valueId;\n    });\n\n    return checkedValue.join('_');\n  },\n  changeSpecInfo: function () {\n    let checkedNameValue = this.getCheckedSpecValue();\n\n    //设置选择的信息\n    let checkedValue = checkedNameValue.filter(function (v) {\n      if (v.valueId != 0) {\n        return true;\n      } else {\n        return false;\n      }\n    }).map(function (v) {\n      return v.valueText;\n    });\n    if (checkedValue.length > 0) {\n      this.setData({\n        'checkedSpecText': checkedValue.join('　')\n      });\n    } else {\n      this.setData({\n        'checkedSpecText': '请选择规格数量'\n      });\n    }\n\n  },\n  getCheckedProductItem: function (key) {\n    return this.data.productList.filter(function (v) {\n      if (v.goods_specification_ids == key) {\n        return true;\n      } else {\n        return false;\n      }\n    });\n  },\n  onLoad: function (options) {\n    // 页面初始化 options为页面跳转所带来的参数\n    this.setData({\n      id: parseInt(options.id)\n      // id: 1181000\n    });\n    var that = this;\n    this.getGoodsInfo();\n    util.request(api.CartGoodsCount).then(function (res) {\n      if (res.errno === 0) {\n        that.setData({\n          cartGoodsCount: res.data.cartTotal.goodsCount\n        });\n\n      }\n    });\n  },\n  onReady: function () {\n    // 页面渲染完成\n\n  },\n  onShow: function () {\n    // 页面显示\n\n  },\n  onHide: function () {\n    // 页面隐藏\n\n  },\n  onUnload: function () {\n    // 页面关闭\n\n  },\n  switchAttrPop: function () {\n    if (this.data.openAttr == false) {\n      this.setData({\n        openAttr: !this.data.openAttr\n      });\n    }\n  },\n  closeAttr: function () {\n    this.setData({\n      openAttr: false,\n    });\n  },\n  addCannelCollect: function () {\n    let that = this;\n    //添加或是取消收藏\n    util.request(api.CollectAddOrDelete, { typeId: 0, valueId: this.data.id }, \"POST\")\n      .then(function (res) {\n        let _res = res;\n        if (_res.errno == 0) {\n          if (_res.data.type == 'add') {\n            that.setData({\n              'collectBackImage': that.data.hasCollectImage\n            });\n          } else {\n            that.setData({\n              'collectBackImage': that.data.noCollectImage\n            });\n          }\n\n        } else {\n          wx.showToast({\n            image: '/static/images/icon_error.png',\n            title: _res.errmsg,\n            mask: true\n          });\n        }\n      });\n  },\n  openCartPage: function () {\n    wx.switchTab({\n      url: '/pages/cart/cart',\n    });\n  },\n  addToCart: function () {\n    var that = this;\n    if (this.data.openAttr === false) {\n      //打开规格选择窗口\n      this.setData({\n        openAttr: !this.data.openAttr\n      });\n    } else {\n\n      //提示选择完整规格\n      if (!this.isCheckedAllSpec()) {\n        wx.showToast({\n          image: '/static/images/icon_error.png',\n          title: '请选择规格',\n          mask: true\n        });\n        return false;\n      }\n\n      //根据选中的规格，判断是否有对应的sku信息\n      let checkedProduct = this.getCheckedProductItem(this.getCheckedSpecKey());\n      if (!checkedProduct || checkedProduct.length <= 0) {\n        //找不到对应的product信息，提示没有库存\n        wx.showToast({\n          image: '/static/images/icon_error.png',\n          title: '库存不足',\n          mask: true\n        });\n        return false;\n      }\n\n      //验证库存\n      if (checkedProduct.goods_number < this.data.number) {\n        //找不到对应的product信息，提示没有库存\n        wx.showToast({\n          image: '/static/images/icon_error.png',\n          title: '库存不足',\n          mask: true\n        });\n        return false;\n      }\n\n      //添加到购物车\n      util.request(api.CartAdd, { goodsId: this.data.goods.id, number: this.data.number, productId: checkedProduct[0].id }, \"POST\")\n        .then(function (res) {\n          let _res = res;\n          if (_res.errno == 0) {\n            wx.showToast({\n              title: '添加成功'\n            });\n            that.setData({\n              openAttr: !that.data.openAttr,\n              cartGoodsCount: _res.data.cartTotal.goodsCount\n            });\n          } else {\n            wx.showToast({\n              image: '/static/images/icon_error.png',\n              title: _res.errmsg,\n              mask: true\n            });\n          }\n\n        });\n    }\n\n  },\n  cutNumber: function () {\n    this.setData({\n      number: (this.data.number - 1 > 1) ? this.data.number - 1 : 1\n    });\n  },\n  addNumber: function () {\n    this.setData({\n      number: this.data.number + 1\n    });\n  }\n})"
  },
  {
    "path": "pages/goods/goods.json",
    "content": "{}"
  },
  {
    "path": "pages/goods/goods.wxml",
    "content": "<view class=\"container\">\n  <swiper class=\"goodsimgs\" indicator-dots=\"true\" autoplay=\"true\" interval=\"3000\" duration=\"1000\">\n    <swiper-item wx:for=\"{{gallery}}\" wx:key=\"{{item.id}}\">\n      <image src=\"{{item.img_url}}\" background-size=\"cover\"></image>\n    </swiper-item>\n  </swiper>\n  <view class=\"service-policy\">\n    <view class=\"item\">30天无忧退货</view>\n    <view class=\"item\">48小时快速退款</view>\n    <view class=\"item\">满88元免邮费</view>\n  </view>\n  <view class=\"goods-info\">\n    <view class=\"c\">\n      <text class=\"name\">{{goods.name}}</text>\n      <text class=\"desc\">{{goods.goods_brief}}</text>\n      <text class=\"price\">￥{{goods.retail_price}}</text>\n      <view class=\"brand\" wx:if=\"{{brand.name}}\">\n        <navigator url=\"../brandDetail/brandDetail?id={{brand.brandId}}\">\n          <text>{{brand.name}}</text>\n        </navigator>\n      </view>\n    </view>\n  </view>\n  <view class=\"section-nav section-attr\" bindtap=\"switchAttrPop\">\n    <view class=\"t\">请选择规格数量</view>\n    <image class=\"i\" src=\"../../static/images/address_right.png\" background-size=\"cover\"></image>\n  </view>\n  <!--<view class=\"section-nav section-act\">\n      <view class=\"t\">\n        <view class=\"label\">1个促销:</view>\n        <view class=\"tag\">万圣趴</view>\n        <view class=\"text\">全场满499，额外送糖果</view>\n      </view>\n      <image class=\"i\" src=\"../../static/images/address_right.png\" background-size=\"cover\"></image>\n    </view>-->\n  <view class=\"comments\" wx:if=\"{{comment.count > 0}}\">\n    <view class=\"h\">\n      <navigator url=\"../comment/comment?valueId={{goods.id}}&typeId=0\">\n        <text class=\"t\">评价({{comment.count > 999 ? '999+' : comment.count}})</text>\n        <text class=\"i\">查看全部</text>\n      </navigator>\n    </view>\n    <view class=\"b\">\n      <view class=\"item\">\n        <view class=\"info\">\n          <view class=\"user\">\n            <image src=\"{{comment.data.avatar}}\"></image>\n            <text>{{comment.data.nickname}}</text>\n          </view>\n          <view class=\"time\">{{comment.data.add_time}}</view>\n        </view>\n        <view class=\"content\">\n          {{comment.data.content}}\n        </view>\n        <view class=\"imgs\" wx:if=\"{{comment.data.pic_list.length > 0}}\">\n          <image class=\"img\" wx:for=\"{{comment.data.pic_list}}\" wx:key=\"{{item.id}}\" src=\"{{item.pic_url}}\"></image>\n        </view>\n        <!-- <view class=\"spec\">白色 2件</view> -->\n      </view>\n    </view>\n  </view>\n  <view class=\"goods-attr\">\n    <view class=\"t\">商品参数</view>\n    <view class=\"l\">\n      <view class=\"item\" wx:for=\"{{attribute}}\" wx:key=\"{{item.name}}\">\n        <text class=\"left\">{{item.name}}</text>\n        <text class=\"right\">{{item.value}}</text>\n      </view>\n    </view>\n  </view>\n\n  <view class=\"detail\">\n    <import src=\"../../lib/wxParse/wxParse.wxml\" />\n    <template is=\"wxParse\" data=\"{{wxParseData:goodsDetail.nodes}}\" />\n  </view>\n\n\n  <view class=\"common-problem\">\n    <view class=\"h\">\n      <view class=\"line\"></view>\n      <text class=\"title\">常见问题</text>\n    </view>\n    <view class=\"b\">\n      <view class=\"item\" wx:for=\"{{issueList}}\" wx:key=\"{{item.id}}\">\n        <view class=\"question-box\">\n          <text class=\"spot\"></text>\n          <text class=\"question\">{{item.question}}</text>\n        </view>\n        <view class=\"answer\">\n          {{item.answer}}\n        </view>\n      </view>\n    </view>\n  </view>\n\n  <view class=\"related-goods\" wx:if=\"{{relatedGoods.length > 0}}\">\n    <view class=\"h\">\n      <view class=\"line\"></view>\n      <text class=\"title\">大家都在看</text>\n    </view>\n    <view class=\"b\">\n      <view class=\"item\" wx:for=\"{{relatedGoods}}\" wx:key=\"{{item.id}}\">\n        <navigator url=\"/pages/goods/goods?id={{item.id}}\">\n          <image class=\"img\" src=\"{{item.list_pic_url}}\" background-size=\"cover\"></image>\n          <text class=\"name\">{{item.name}}</text>\n          <text class=\"price\">￥{{item.retail_price}}</text>\n        </navigator>\n      </view>\n    </view>\n  </view>\n</view>\n<view class=\"attr-pop-box\" hidden=\"{{!openAttr}}\">\n  <view class=\"attr-pop\">\n    <view class=\"close\" bindtap=\"closeAttr\">\n      <image class=\"icon\" src=\"/static/images/icon_close.png\"></image>\n    </view>\n    <view class=\"img-info\">\n      <image class=\"img\" src=\"{{gallery[0].img_url}}\"></image>\n      <view class=\"info\">\n        <view class=\"c\">\n          <view class=\"p\">价格：￥{{goods.retail_price}}</view>\n          <view class=\"a\" wx:if=\"{{productList.length>0}}\">已选择：{{checkedSpecText}}</view>\n        </view>\n      </view>\n    </view>\n    <view class=\"spec-con\">\n      <view class=\"spec-item\" wx:for=\"{{specificationList}}\" wx:key=\"{{item.specification_id}}\">\n        <view class=\"name\">{{item.name}}</view>\n        <view class=\"values\">\n          <view class=\"value {{vitem.checked ? 'selected' : ''}}\" bindtap=\"clickSkuValue\" wx:for=\"{{item.valueList}}\" wx:for-item=\"vitem\" wx:key=\"{{vitem.id}}\" data-value-id=\"{{vitem.id}}\" data-name-id=\"{{vitem.specification_id}}\">{{vitem.value}}</view>\n        </view>\n      </view>\n\n      <view class=\"number-item\">\n        <view class=\"name\">数量</view>\n        <view class=\"selnum\">\n          <view class=\"cut\" bindtap=\"cutNumber\">-</view>\n          <input value=\"{{number}}\" class=\"number\" disabled=\"true\" type=\"number\" />\n          <view class=\"add\" bindtap=\"addNumber\">+</view>\n        </view>\n      </view>\n    </view>\n  </view>\n</view>\n<view class=\"bottom-btn\">\n  <view class=\"l l-collect\" bindtap=\"addCannelCollect\">\n    <image class=\"icon\" src=\"{{ collectBackImage }}\"></image>\n  </view>\n  <view class=\"l l-cart\">\n    <view class=\"box\">\n      <text class=\"cart-count\">{{cartGoodsCount}}</text>\n      <image bindtap=\"openCartPage\" class=\"icon\" src=\"/static/images/ic_menu_shoping_nor.png\"></image>\n    </view>\n  </view>\n  <view class=\"c\">立即购买</view>\n  <view class=\"r\" bindtap=\"addToCart\">加入购物车</view>\n</view>"
  },
  {
    "path": "pages/goods/goods.wxss",
    "content": ".container {\n  margin-bottom: 100rpx;\n}\n\n.goodsimgs {\n  width: 750rpx;\n  height: 750rpx;\n}\n\n.goodsimgs image {\n  width: 750rpx;\n  height: 750rpx;\n}\n\n.service-policy {\n  width: 750rpx;\n  height: 73rpx;\n  background: #f4f4f4;\n  padding: 0 31.25rpx;\n  display: flex;\n  flex-flow: row nowrap;\n  align-items: center;\n  justify-content: space-between;\n}\n\n.service-policy .item {\n  background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/servicePolicyRed-518d32d74b.png) 0 center no-repeat;\n  background-size: 10rpx;\n  padding-left: 15rpx;\n  display: flex;\n  align-items: center;\n  font-size: 25rpx;\n  color: #666;\n}\n\n.goods-info {\n  width: 750rpx;\n  height: 306rpx;\n  overflow: hidden;\n  background: #fff;\n}\n\n.goods-info .c {\n  display: block;\n  width: 718.75rpx;\n  height: 100%;\n  margin-left: 31.25rpx;\n  padding: 38rpx 31.25rpx 38rpx 0;\n  border-bottom: 1px solid #f4f4f4;\n}\n\n.goods-info .c text {\n  display: block;\n  width: 687.5rpx;\n  text-align: center;\n}\n\n.goods-info .name {\n  height: 41rpx;\n  margin-bottom: 5.208rpx;\n  font-size: 41rpx;\n  line-height: 41rpx;\n}\n\n.goods-info .desc {\n  height: 43rpx;\n  margin-bottom: 41rpx;\n  font-size: 24rpx;\n  line-height: 36rpx;\n  color: #999;\n}\n\n.goods-info .price {\n  height: 35rpx;\n  font-size: 35rpx;\n  line-height: 35rpx;\n  color: #b4282d;\n}\n\n.goods-info .brand {\n  margin-top: 23rpx;\n  min-height: 40rpx;\n  text-align: center;\n}\n\n.goods-info .brand text {\n  display: inline-block;\n  width: auto;\n  padding: 2px 30rpx 2px 10.5rpx;\n  line-height: 35.5rpx;\n  border: 1px solid #f48f18;\n  font-size: 25rpx;\n  color: #f48f18;\n  border-radius: 4px;\n  background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/detailTagArrow-18bee52dab.png) 95% center no-repeat;\n  background-size: 10.75rpx 18.75rpx;\n}\n\n.section-nav {\n  width: 750rpx;\n  height: 108rpx;\n  background: #fff;\n  margin-bottom: 20rpx;\n}\n\n.section-nav .t {\n  float: left;\n  width: 600rpx;\n  height: 108rpx;\n  line-height: 108rpx;\n  font-size: 29rpx;\n  color: #333;\n  margin-left: 31.25rpx;\n}\n\n.section-nav .i {\n  float: right;\n  width: 52rpx;\n  height: 52rpx;\n  margin-right: 16rpx;\n  margin-top: 28rpx;\n}\n\n.section-act .t {\n  float: left;\n  display: flex;\n  align-items: center;\n  width: 600rpx;\n  height: 108rpx;\n  overflow: hidden;\n  line-height: 108rpx;\n  font-size: 29rpx;\n  color: #999;\n  margin-left: 31.25rpx;\n}\n\n.section-act .label {\n  color: #999;\n}\n\n.section-act .tag {\n  display: flex;\n  align-items: center;\n  padding: 0 10rpx;\n  border-radius: 3px;\n  height: 37rpx;\n  width: auto;\n  color: #f48f18;\n  overflow: hidden;\n  border: 1px solid #f48f18;\n  font-size: 25rpx;\n  margin: 0 10rpx;\n}\n\n.section-act .text {\n  display: flex;\n  align-items: center;\n  height: 37rpx;\n  width: auto;\n  overflow: hidden;\n  color: #f48f18;\n  font-size: 29rpx;\n}\n\n.comments {\n  width: 100%;\n  height: auto;\n  padding-left: 30rpx;\n  background: #fff;\n  margin: 20rpx 0;\n}\n\n.comments .h {\n  height: 102.5rpx;\n  line-height: 100.5rpx;\n  width: 718.75rpx;\n  padding-right: 16rpx;\n  border-bottom: 1px solid #d9d9d9;\n}\n\n.comments .h .t {\n  display: block;\n  float: left;\n  width: 50%;\n  font-size: 38.5rpx;\n  color: #333;\n}\n\n.comments .h .i {\n  display: block;\n  float: right;\n  width: 164rpx;\n  height: 100.5rpx;\n  line-height: 100.5rpx;\n  background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/address-right-990628faa7.png) right center no-repeat;\n  background-size: 52rpx;\n}\n\n.comments .b {\n  height: auto;\n  width: 720rpx;\n}\n\n.comments .item {\n  height: auto;\n  width: 720rpx;\n  overflow: hidden;\n}\n\n.comments .info {\n  height: 127rpx;\n  width: 100%;\n  padding: 33rpx 0 27rpx 0;\n}\n\n.comments .user {\n  float: left;\n  width: auto;\n  height: 67rpx;\n  line-height: 67rpx;\n  font-size: 0;\n}\n\n.comments .user image {\n  float: left;\n  width: 67rpx;\n  height: 67rpx;\n  margin-right: 17rpx;\n  border-radius: 50%;\n}\n\n.comments .user text {\n  display: inline-block;\n  width: auto;\n  height: 66rpx;\n  overflow: hidden;\n  font-size: 29rpx;\n  line-height: 66rpx;\n}\n\n.comments .time {\n  display: block;\n  float: right;\n  width: auto;\n  height: 67rpx;\n  line-height: 67rpx;\n  color: #7f7f7f;\n  font-size: 25rpx;\n  margin-right: 30rpx;\n}\n\n.comments .content {\n  width: 720rpx;\n  padding-right: 30rpx;\n  line-height: 45.8rpx;\n  font-size: 29rpx;\n  margin-bottom: 24rpx;\n}\n\n.comments .imgs {\n  width: 720rpx;\n  height: auto;\n  margin-bottom: 25rpx;\n}\n\n.comments .imgs .img {\n  height: 150rpx;\n  width: 150rpx;\n  margin-right: 28rpx;\n}\n\n.comments .spec {\n  width: 720rpx;\n  padding-right: 30rpx;\n  line-height: 30rpx;\n  font-size: 24rpx;\n  color: #999;\n  margin-bottom: 30rpx;\n}\n\n.goods-attr {\n  width: 750rpx;\n  height: auto;\n  overflow: hidden;\n  padding: 0 31.25rpx 25rpx 31.25rpx;\n  background: #fff;\n}\n\n.goods-attr .t {\n  width: 687.5rpx;\n  height: 104rpx;\n  line-height: 104rpx;\n  font-size: 38.5rpx;\n}\n\n.goods-attr .item {\n  width: 687.5rpx;\n  height: 68rpx;\n  padding: 11rpx 20rpx;\n  margin-bottom: 11rpx;\n  background: #f7f7f7;\n  font-size: 38.5rpx;\n}\n\n.goods-attr .left {\n  float: left;\n  font-size: 25rpx;\n  width: 134rpx;\n  height: 45rpx;\n  line-height: 45rpx;\n  overflow: hidden;\n  color: #999;\n}\n\n.goods-attr .right {\n  float: left;\n  font-size: 36.5rpx;\n  margin-left: 20rpx;\n  width: 480rpx;\n  height: 45rpx;\n  line-height: 45rpx;\n  overflow: hidden;\n  color: #333;\n}\n\n.detail {\n  width: 750rpx;\n  height: auto;\n  overflow: hidden;\n}\n\n.detail image {\n  width: 750rpx;\n  display: block;\n}\n\n.common-problem {\n  width: 750rpx;\n  height: auto;\n  overflow: hidden;\n}\n\n.common-problem .h {\n  position: relative;\n  height: 145.5rpx;\n  width: 750rpx;\n  padding: 56.25rpx 0;\n  background: #fff;\n  text-align: center;\n}\n\n.common-problem .h .line {\n  display: inline-block;\n  position: absolute;\n  top: 72rpx;\n  left: 0;\n  z-index: 2;\n  height: 1px;\n  margin-left: 225rpx;\n  width: 300rpx;\n  background: #ccc;\n}\n\n.common-problem .h .title {\n  display: inline-block;\n  position: absolute;\n  top: 56.125rpx;\n  left: 0;\n  z-index: 3;\n  height: 33rpx;\n  margin-left: 285rpx;\n  width: 180rpx;\n  background: #fff;\n}\n\n.common-problem .b {\n  width: 750rpx;\n  height: auto;\n  overflow: hidden;\n  padding: 0rpx 30rpx;\n  background: #fff;\n}\n\n.common-problem .item {\n  height: auto;\n  overflow: hidden;\n  padding-bottom: 25rpx;\n}\n\n.common-problem .question-box .spot {\n  float: left;\n  display: block;\n  height: 8rpx;\n  width: 8rpx;\n  background: #b4282d;\n  border-radius: 50%;\n  margin-top: 11rpx;\n}\n\n.common-problem .question-box .question {\n  float: left;\n  line-height: 30rpx;\n  padding-left: 8rpx;\n  display: block;\n  font-size: 26rpx;\n  padding-bottom: 15rpx;\n  color: #303030;\n}\n\n.common-problem .answer {\n  line-height: 36rpx;\n  padding-left: 16rpx;\n  font-size: 26rpx;\n  color: #787878;\n}\n\n.related-goods {\n  width: 750rpx;\n  height: auto;\n  overflow: hidden;\n}\n\n.related-goods .h {\n  position: relative;\n  height: 145.5rpx;\n  width: 750rpx;\n  padding: 56.25rpx 0;\n  background: #fff;\n  text-align: center;\n  border-bottom: 1px solid #f4f4f4;\n}\n\n.related-goods .h .line {\n  display: inline-block;\n  position: absolute;\n  top: 72rpx;\n  left: 0;\n  z-index: 2;\n  height: 1px;\n  margin-left: 225rpx;\n  width: 300rpx;\n  background: #ccc;\n}\n\n.related-goods .h .title {\n  display: inline-block;\n  position: absolute;\n  top: 56.125rpx;\n  left: 0;\n  z-index: 3;\n  height: 33rpx;\n  margin-left: 285rpx;\n  width: 180rpx;\n  background: #fff;\n}\n\n.related-goods .b {\n  width: 750rpx;\n  height: auto;\n  overflow: hidden;\n}\n\n.related-goods .b .item {\n  float: left;\n  background: #fff;\n  width: 375rpx;\n  height: auto;\n  overflow: hidden;\n  text-align: center;\n  padding: 15rpx 31.25rpx;\n  border-right: 1px solid #f4f4f4;\n  border-bottom: 1px solid #f4f4f4;\n}\n\n.related-goods .item .img {\n  width: 311.45rpx;\n  height: 311.45rpx;\n}\n\n.related-goods .item .name {\n  display: block;\n  width: 311.45rpx;\n  height: 35rpx;\n  margin: 11.5rpx 0 15rpx 0;\n  text-align: center;\n  overflow: hidden;\n  font-size: 30rpx;\n  color: #333;\n}\n\n.related-goods .item .price {\n  display: block;\n  width: 311.45rpx;\n  height: 30rpx;\n  text-align: center;\n  font-size: 30rpx;\n  color: #b4282d;\n}\n\n.bottom-btn {\n  position: fixed;\n  left: 0;\n  bottom: 0;\n  z-index: 10;\n  width: 750rpx;\n  height: 100rpx;\n  display: flex;\n  background: #fff;\n}\n\n.bottom-btn .l {\n  float: left;\n  height: 100rpx;\n  width: 162rpx;\n  border: 1px solid #f4f4f4;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n.bottom-btn .l.l-collect {\n  border-right: none;\n  border-left: none;\n  text-align: center;\n}\n\n.bottom-btn .l.l-cart .box {\n  position: relative;\n  height: 60rpx;\n  width: 60rpx;\n}\n\n.bottom-btn .l.l-cart .cart-count {\n  height: 28rpx;\n  width: 28rpx;\n  z-index: 10;\n  position: absolute;\n  top: 0;\n  right: 0;\n  background: #b4282d;\n  text-align: center;\n  font-size: 18rpx;\n  color: #fff;\n  line-height: 28rpx;\n  border-radius: 50%;\n}\n\n.bottom-btn .l.l-cart .icon {\n  position: absolute;\n  top: 10rpx;\n  left: 0;\n}\n\n.bottom-btn .l .icon {\n  display: block;\n  height: 44rpx;\n  width: 44rpx;\n}\n\n.bottom-btn .c {\n  float: left;\n  height: 100rpx;\n  line-height: 96rpx;\n  flex: 1;\n  text-align: center;\n  color: #333;\n  border-top: 1px solid #f4f4f4;\n  border-bottom: 1px solid #f4f4f4;\n}\n\n.bottom-btn .r {\n  border: 1px solid #b4282d;\n  background: #b4282d;\n  float: left;\n  height: 100rpx;\n  line-height: 96rpx;\n  flex: 1;\n  text-align: center;\n  color: #fff;\n}\n@import \"../../lib/wxParse/wxParse.wxss\";\n\n.attr-pop-box {\n  width: 100%;\n  height: 100%;\n  position: fixed;\n  background: rgba(0, 0, 0, .5);\n  z-index: 8;\n  bottom: 0;\n  /* display: none; */\n}\n\n.attr-pop {\n  width: 100%;\n  height: auto;\n  max-height: 780rpx;\n  padding: 31.25rpx;\n  background: #fff;\n  position: fixed;\n  z-index: 9;\n  bottom: 100rpx;\n}\n\n.attr-pop .close {\n  position: absolute;\n  width: 48rpx;\n  height: 48rpx;\n  right: 31.25rpx;\n  overflow: hidden;\n  top: 31.25rpx;\n}\n\n.attr-pop .close .icon {\n  width: 48rpx;\n  height: 48rpx;\n}\n\n.attr-pop .img-info {\n  width: 687.5rpx;\n  height: 177rpx;\n  overflow: hidden;\n  margin-bottom: 41.5rpx;\n}\n\n.attr-pop .img {\n  float: left;\n  height: 177rpx;\n  width: 177rpx;\n  background: #f4f4f4;\n  margin-right: 31.25rpx;\n}\n\n.attr-pop .info {\n  float: left;\n  height: 177rpx;\n  display: flex;\n  align-items: center;\n}\n\n.attr-pop .p {\n  font-size: 33rpx;\n  color: #333;\n  height: 33rpx;\n  line-height: 33rpx;\n  margin-bottom: 10rpx;\n}\n\n.attr-pop .a {\n  font-size: 29rpx;\n  color: #333;\n  height: 40rpx;\n  line-height: 40rpx;\n}\n\n.spec-con {\n  width: 100%;\n  height: auto;\n  overflow: hidden;\n}\n\n.spec-con .name {\n  height: 32rpx;\n  margin-bottom: 22rpx;\n  font-size: 29rpx;\n  color: #333;\n}\n\n.spec-con .values {\n  height: auto;\n  margin-bottom: 31.25rpx;\n  font-size: 0;\n}\n\n.spec-con .value {\n  display: inline-block;\n  height: 62rpx;\n  padding: 0 35rpx;\n  line-height: 56rpx;\n  text-align: center;\n  margin-right: 25rpx;\n  margin-bottom: 16.5rpx;\n  border: 1px solid #333;\n  font-size: 25rpx;\n  color: #333;\n}\n\n.spec-con .value.disable {\n  border: 1px solid #ccc;\n  color: #ccc;\n}\n\n.spec-con .value.selected {\n  border: 1px solid #b4282d;\n  color: #b4282d;\n}\n\n.number-item .selnum {\n  width: 322rpx;\n  height: 71rpx;\n  border: 1px solid #ccc;\n  display: flex;\n}\n\n.number-item .cut {\n  width: 93.75rpx;\n  height: 100%;\n  text-align: center;\n  line-height: 65rpx;\n}\n\n.number-item .number {\n  flex: 1;\n  height: 100%;\n  text-align: center;\n  line-height: 68.75rpx;\n  border-left: 1px solid #ccc;\n  border-right: 1px solid #ccc;\n  float: left;\n}\n\n.number-item .add {\n  width: 93.75rpx;\n  height: 100%;\n  text-align: center;\n  line-height: 65rpx;\n}\n"
  },
  {
    "path": "pages/hotGoods/hotGoods.js",
    "content": "var util = require('../../utils/util.js');\nvar api = require('../../config/api.js');\nvar app = getApp();\n\nPage({\n  data: {\n    bannerInfo: {\n      'img_url': '',\n      'name': ''\n    },\n    categoryFilter: false,\n    filterCategory: [],\n    goodsList: [],\n    categoryId: 0,\n    currentSortType: 'default',\n    currentSortOrder: 'desc',\n    page: 1,\n    size: 1000\n  },\n  getData: function () {\n    let that = this;\n    util.request(api.GoodsHot).then(function (res) {\n      if (res.errno === 0) {\n        that.setData({\n          bannerInfo: res.data.bannerInfo,\n        });\n        that.getGoodsList();\n      }\n    });\n  },\n  getGoodsList (){\n    var that = this;\n\n    util.request(api.GoodsList, { isHot: 1, page: that.data.page, size: that.data.size, order: that.data.currentSortOrder, sort: that.data.currentSortType, categoryId: that.data.categoryId})\n      .then(function (res) {\n        if (res.errno === 0) {\n          that.setData({\n            goodsList: res.data.goodsList,\n            filterCategory: res.data.filterCategory\n          });\n        }\n      });\n  },\n  onLoad: function (options) {\n    // 页面初始化 options为页面跳转所带来的参数\n    this.getData();\n  },\n  onReady: function () {\n    // 页面渲染完成\n  },\n  onShow: function () {\n    // 页面显示\n\n  },\n  onHide: function () {\n    // 页面隐藏\n\n  },\n  onUnload: function () {\n    // 页面关闭\n\n  },\n  openSortFilter: function (event) {\n    let currentId = event.currentTarget.id;\n    switch (currentId) {\n      case 'categoryFilter':\n        this.setData({\n          'categoryFilter': !this.data.categoryFilter,\n          'currentSortType': 'category',\n          'currentSortOrder': 'asc'\n        });\n        break;\n      case 'priceSort':\n        let tmpSortOrder = 'asc';\n        if (this.data.currentSortOrder == 'asc') {\n          tmpSortOrder = 'desc';\n        }\n        this.setData({\n          'currentSortType': 'price',\n          'currentSortOrder': tmpSortOrder,\n          'categoryFilter': false\n        });\n\n        this.getData();\n        break;\n      default:\n        //综合排序\n        this.setData({\n          'currentSortType': 'default',\n          'currentSortOrder': 'desc',\n          'categoryFilter': false\n        });\n        this.getData();\n    }\n  },\n  selectCategory: function(event){\n    let currentIndex = event.target.dataset.categoryIndex;\n    this.setData({\n      'categoryFilter': false,\n      'categoryId': this.data.filterCategory[currentIndex].id\n    });\n    this.getData();\n\n  }\n})"
  },
  {
    "path": "pages/hotGoods/hotGoods.json",
    "content": "{\n    \n}"
  },
  {
    "path": "pages/hotGoods/hotGoods.wxml",
    "content": "<view class=\"container\">\n  <view class=\"brand-info\">\n    <view class=\"name\">\n      <image class=\"img\" src=\"{{bannerInfo.img_url}}\" background-size=\"cover\"></image>\n      <view class=\"info-box\">\n        <view class=\"info\">\n          <text class=\"txt\">{{bannerInfo.name}}</text>\n          <text class=\"line\"></text>\n        </view>\n      </view>\n    </view>\n  </view>\n  <view class=\"sort\">\n    <view class=\"sort-box\">\n      <view class=\"item {{currentSortType == 'default' ? 'active' : ''}}\"  bindtap=\"openSortFilter\" id=\"defaultSort\">\n        <text class=\"txt\">综合</text>\n      </view>\n      <view class=\"item by-price {{currentSortType == 'price' ? 'active' : ''}} {{currentSortOrder == 'asc'  ? 'asc' : 'desc'}}\" bindtap=\"openSortFilter\" id=\"priceSort\">\n        <text class=\"txt\">价格</text>\n      </view>\n      <view class=\"item {{currentSortType == 'category' ? 'active' : ''}}\" bindtap=\"openSortFilter\" id=\"categoryFilter\">\n        <text class=\"txt\">分类</text>\n      </view>\n    </view>\n    <view class=\"sort-box-category\" wx-if=\"{{categoryFilter}}\">\n      <view class=\"item {{item.checked ? 'active' : ''}}\" wx:for=\"{{filterCategory}}\" wx:key=\"cate-{{item.id}}\" data-category-index=\"{{index}}\" bindtap=\"selectCategory\">{{item.name}}</view>\n    </view>\n  </view>\n  <view class=\"cate-item\">\n    <view class=\"b\">\n      <block wx:for=\"{{goodsList}}\" wx:for-index=\"iindex\" wx:for-item=\"iitem\" wx:key=\"unique\">\n        <navigator class=\"item {{iindex % 2 == 0 ? 'item-b' : '' }}\" url=\"../goods/goods?id={{iitem.id}}\">\n          <image class=\"img\" src=\"{{iitem.list_pic_url}}\" background-size=\"cover\"></image>\n          <text class=\"name\">{{iitem.name}}</text>\n          <text class=\"price\">￥{{iitem.retail_price}}</text>\n        </navigator>\n      </block>\n    </view>\n  </view>\n</view>"
  },
  {
    "path": "pages/hotGoods/hotGoods.wxss",
    "content": "page{\n    background: #f4f4f4;\n}\n\n.brand-info .name{\n    width: 100%;\n    height: 278rpx;\n    position: relative;\n}\n\n.brand-info .img{\n    position: absolute;\n    top:0;\n    left:0;\n    width: 100%;\n    height: 278rpx;\n}\n\n.brand-info .info-box{\n    position: absolute;\n    top:0;\n    left:0;\n    width: 100%;\n    height: 278rpx;\n    text-align: center;\n    display: flex;\n    justify-content: center;\n    align-items: center;\n}\n\n.brand-info .info{\n    display: block;\n}\n\n.brand-info .txt{\n    display: block;\n    height: 40rpx;\n    font-size: 37.5rpx;\n    color: #fff;\n}\n\n.brand-info .line{\n    margin: 0 auto;\n    margin-top: 16rpx;\n    display: block;\n    height: 2rpx;\n    width: 145rpx;\n    background: #fff;\n}\n\n.sort{\n    position: relative;\n    background: #fff;\n    width: 100%;\n    height: 78rpx;\n}\n\n.sort-box{\n    background: #fff;\n    width: 100%;\n    height: 78rpx;\n    overflow: hidden;\n    padding: 0 30rpx;\n    display: flex;\n    border-bottom: 1px solid #d9d9d9;\n}\n\n.sort-box .item{\n    height: 78rpx;\n    line-height: 78rpx;\n    text-align: center;\n    flex:1;\n    color: #333;\n    font-size: 30rpx;\n}\n\n.sort-box .item .txt{\n    display: block;\n    width: 100%;\n    height: 100%;\n    color: #333;\n}\n\n.sort-box .item.active .txt{\n    color: #b4282d;\n}\n\n.sort-box .item.by-price{\n    background: url(//yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/no-3127092a69.png) 155rpx center no-repeat;\n    background-size: 15rpx 21rpx;\n}\n\n.sort-box .item.by-price.active.asc{\n    background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/up-636b92c0a5.png) 155rpx center no-repeat;\n    background-size: 15rpx 21rpx;\n}\n\n.sort-box .item.by-price.active.desc{\n    background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/down-95e035f3e5.png) 155rpx center no-repeat;\n    background-size: 15rpx 21rpx;\n}\n\n.sort-box-category{\n    background: #fff;\n    width: 100%;\n    height: auto;\n    overflow: hidden;\n    padding: 40rpx 40rpx 0 0;\n    border-bottom: 1px solid #d9d9d9;\n}\n\n.sort-box-category .item{\n    height: 54rpx;\n    line-height: 54rpx;\n    text-align: center;\n    float: left;\n    padding: 0 16rpx;\n    margin: 0 0 40rpx 40rpx;\n    border: 1px solid #666;\n    color: #333;\n    font-size: 24rpx;\n}\n\n.sort-box-category .item.active{\n    color: #b4282d;\n    border: 1px solid #b4282d;\n}\n\n.cate-item .b{\n  width: 750rpx;\n  height: auto;\n  overflow: hidden;\n  border-top: 1rpx solid #f4f4f4;\n  margin-top: 20rpx;\n}\n\n.cate-item .b .item{\n  float: left;\n  background: #fff;\n  width: 375rpx;\n  padding-bottom: 33.333rpx;\n  border-bottom: 1rpx solid #f4f4f4;\n  height: auto;\n  overflow: hidden;\n  text-align: center;\n}\n\n.cate-item .b .item-b{\n border-right: 1rpx solid #f4f4f4;\n}\n\n.cate-item .item .img{\n    margin-top: 10rpx;\n  width: 302rpx;\n  height: 302rpx;\n}\n\n.cate-item .item .name{\n  display: block;\n  width: 365.625rpx;\n  height: 35rpx;\n  padding: 0 20rpx;\n  overflow: hidden;\n  margin: 11.5rpx 0 22rpx 0;\n  text-align: center;\n  font-size: 30rpx;\n  color: #333;\n}\n\n.cate-item .item .price{\n  display: block;\n  width: 365.625rpx;\n  height: 30rpx;\n  text-align: center;\n  font-size: 30rpx;\n  color: #b4282d;\n}"
  },
  {
    "path": "pages/index/index.js",
    "content": "const util = require('../../utils/util.js');\nconst api = require('../../config/api.js');\nconst user = require('../../services/user.js');\n\n//获取应用实例\nconst app = getApp()\nPage({\n  data: {\n    goodsCount: 0,\n    newGoods: [],\n    hotGoods: [],\n    topics: [],\n    brands: [],\n    floorGoods: [],\n    banner: [],\n    channel: []\n  },\n  onShareAppMessage: function () {\n    return {\n      title: 'NideShop',\n      desc: '仿网易严选微信小程序商城',\n      path: '/pages/index/index'\n    }\n  },\n\n  getIndexData: function () {\n    let that = this;\n    util.request(api.IndexUrl).then(function (res) {\n      if (res.errno === 0) {\n        that.setData({\n          newGoods: res.data.newGoodsList,\n          hotGoods: res.data.hotGoodsList,\n          topics: res.data.topicList,\n          brand: res.data.brandList,\n          floorGoods: res.data.categoryList,\n          banner: res.data.banner,\n          channel: res.data.channel\n        });\n      }\n    });\n  },\n  onLoad: function (options) {\n    this.getIndexData();\n    util.request(api.GoodsCount).then(res => {\n      this.setData({\n        goodsCount: res.data.goodsCount\n      });\n    });\n  },\n  onReady: function () {\n    // 页面渲染完成\n  },\n  onShow: function () {\n    // 页面显示\n  },\n  onHide: function () {\n    // 页面隐藏\n  },\n  onUnload: function () {\n    // 页面关闭\n  },\n})\n"
  },
  {
    "path": "pages/index/index.json",
    "content": "{}"
  },
  {
    "path": "pages/index/index.wxml",
    "content": "<!--index.wxml-->\n<view class=\"container\">\n  <view class=\"search\">\n    <navigator url=\"/pages/search/search\" class=\"input\">\n      <image class=\"icon\"></image>\n      <text class=\"txt\">商品搜索, 共{{goodsCount}}款好物</text>\n    </navigator>\n  </view>\n  <swiper class=\"banner\" indicator-dots=\"true\" autoplay=\"true\" interval=\"3000\" duration=\"1000\">\n    <swiper-item wx:for=\"{{banner}}\" wx:key=\"{{item.id}}\">\n      <navigator url=\"{{item.link}}\">\n        <image src=\"{{item.image_url}}\" background-size=\"cover\"></image>\n      </navigator>\n    </swiper-item>\n  </swiper>\n  <view class=\"m-menu\">\n    <navigator class=\"item\" url=\"{{item.url}}\" wx:for=\"{{channel}}\" wx:key=\"{{item.id}}\">\n      <image src=\"{{item.icon_url}}\" background-size=\"cover\"></image>\n      <text>{{item.name}}</text>\n    </navigator>\n  </view>\n  <view class=\"a-section a-brand\">\n    <view class=\"h\">\n      <navigator url=\"../brand/brand\">\n        <text class=\"txt\">品牌制造商直供</text>\n      </navigator>\n    </view>\n    <view class=\"b\">\n      <view class=\"item item-1\" wx:for=\"{{brand}}\" wx:key=\"item.id\">\n        <navigator url=\"/pages/brandDetail/brandDetail?id={{item.id}}\">\n          <view class=\"wrap\">\n            <image class=\"img\" src=\"{{item.new_pic_url}}\" mode=\"aspectFill\"></image>\n            <view class=\"mt\">\n              <text class=\"brand\">{{item.name}}</text>\n              <text class=\"price\">{{item.floor_price}}</text>\n              <text class=\"unit\">元起</text>\n            </view>\n          </view>\n        </navigator>\n      </view>\n    </view>\n  </view>\n  <view class=\"a-section a-new\" wx:if=\"{{newGoods.length > 0}}\">\n    <view class=\"h\">\n      <view>\n        <navigator url=\"../newGoods/newGoods\">\n          <text class=\"txt\">周一周四 · 新品首发</text>\n        </navigator>\n      </view>\n    </view>\n    <view class=\"b\">\n      <view class=\"item\" wx:for=\"{{newGoods}}\" wx:for-index=\"index\" wx:for-item=\"item\" wx:key=\"{{item.id}}\">\n        <navigator url=\"../goods/goods?id={{item.id}}\">\n          <image class=\"img\" src=\"{{item.list_pic_url}}\" background-size=\"cover\"></image>\n          <text class=\"name\">{{item.name}}</text>\n          <text class=\"price\">￥{{item.retail_price}}</text>\n        </navigator>\n      </view>\n    </view>\n  </view>\n  <view class=\"a-section a-popular\" wx:if=\"{{hotGoods.length > 0}}\">\n    <view class=\"h\">\n      <view>\n        <navigator url=\"../hotGoods/hotGoods\">\n          <text class=\"txt\">人气推荐</text>\n        </navigator>\n      </view>\n    </view>\n    <view class=\"b\">\n      <view class=\"item\" wx:for=\"{{hotGoods}}\" wx:for-index=\"index\" wx:for-item=\"item\" wx:key=\"{{item.id}}\">\n        <navigator url=\"/pages/goods/goods?id={{item.id}}\">\n          <image class=\"img\" src=\"{{item.list_pic_url}}\" background-size=\"cover\"></image>\n          <view class=\"right\">\n            <view class=\"text\">\n              <text class=\"name\">{{item.name}}</text>\n              <text class=\"desc\">{{item.goods_brief}}</text>\n              <text class=\"price\">￥{{item.retail_price}}</text>\n            </view>\n          </view>\n        </navigator>\n      </view>\n    </view>\n  </view>\n  <view class=\"a-section a-topic\" wx:if=\"topics.length > 0\">\n    <view class=\"h\">\n      <view>\n        <navigator url=\"../topic/topic\" open-type=\"switchTab\">\n          <text class=\"txt\">专题精选</text>\n        </navigator>\n      </view>\n    </view>\n    <view class=\"b\">\n      <scroll-view scroll-x=\"true\" class=\"list\">\n        <view class=\"item\" wx:for=\"{{topics}}\" wx:for-index=\"index\" wx:for-item=\"item\" wx:key=\"{{item.id}}\">\n          <navigator url=\"../topicDetail/topicDetail?id={{item.id}}\">\n            <image class=\"img\" src=\"{{item.scene_pic_url}}\" background-size=\"cover\"></image>\n            <view class=\"np\">\n              <text class=\"name\">{{item.title}}</text>\n              <text class=\"price\">￥{{item.price_info}}元起</text>\n            </view>\n            <text class=\"desc\">{{item.subtitle}}</text>\n          </navigator>\n        </view>\n      </scroll-view>\n    </view>\n  </view>\n  <view class=\"good-grid\" wx:for=\"{{floorGoods}}\" wx:key=\"{{item.id}}\">\n    <view class=\"h\">\n      <view>\n        <text>{{item.name}}</text>\n      </view>\n    </view>\n    <view class=\"b\">\n      <block wx:for=\"{{item.goodsList}}\" wx:for-index=\"iindex\" wx:for-item=\"iitem\" wx:key=\"{{iitem.id}}\">\n        <navigator url=\"../goods/goods?id={{iitem.id}}\" class=\"item\">\n          <image class=\"img\" src=\"{{iitem.list_pic_url}}\" background-size=\"cover\"></image>\n          <view class=\"name\">{{iitem.name}}</view>\n          <view class=\"price\">￥{{iitem.retail_price}}</view>\n        </navigator>\n      </block>\n    </view>\n  </view>\n</view>"
  },
  {
    "path": "pages/index/index.wxss",
    "content": "\n.search {\n  height: 88rpx;\n  width: 100%;\n  padding: 0 30rpx;\n  background: #fff;\n  display: flex;\n  align-items: center;\n}\n\n.search .input {\n  width: 690rpx;\n  height: 56rpx;\n  background: #ededed;\n  border-radius: 8rpx;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n.search .icon {\n  background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/search2-2fb94833aa.png) center no-repeat;\n  background-size: 100%;\n  width: 28rpx;\n  height: 28rpx;\n}\n\n.search .txt {\n  height: 42rpx;\n  line-height: 42rpx;\n  color: #666;\n  padding-left: 10rpx;\n  font-size: 30rpx;\n}\n\n.banner {\n  width: 750rpx;\n  height: 417rpx;\n}\n\n.banner image {\n  width: 100%;\n  height: 417rpx;\n}\n\n.m-menu {\n  display: flex;\n  height: 181rpx;\n  width: 750rpx;\n  flex-flow: row nowrap;\n  align-items: center;\n  justify-content: space-between;\n  background-color: #fff;\n}\n\n.m-menu .item {\n  flex: 1;\n  display: block;\n  padding: 20rpx 0;\n}\n\n.m-menu image {\n  display: block;\n  width: 58rpx;\n  height: 58rpx;\n  margin: 0 auto;\n  margin-bottom: 12rpx;\n}\n\n.m-menu text {\n  display: block;\n  font-size: 24rpx;\n  text-align: center;\n  margin: 0 auto;\n  line-height: 1;\n  color: #333;\n}\n\n.a-section {\n  width: 750rpx;\n  height: auto;\n  overflow: hidden;\n  background: #fff;\n  color: #333;\n  margin-top: 20rpx;\n}\n\n.a-section .h {\n  display: flex;\n  flex-flow: row nowrap;\n  align-items: center;\n  justify-content: center;\n  height: 130rpx;\n}\n\n.a-section .h .txt {\n  padding-right: 30rpx;\n  background: url(\"http://ac-3yr0g9cz.clouddn.com/2cdba05369e10f934e54.png\") right 4rpx no-repeat;\n  background-size: 16.656rpx 27rpx;\n  display: inline-block;\n  height: 36rpx;\n  font-size: 33rpx;\n  line-height: 36rpx;\n}\n\n.a-brand .b {\n  width: 750rpx;\n  height: auto;\n  overflow: hidden;\n  position: relative;\n}\n\n.a-brand .wrap {\n  position: relative;\n}\n\n.a-brand .img {\n  position: absolute;\n  left: 0;\n  top: 0;\n}\n\n.a-brand .mt {\n  position: absolute;\n  z-index: 2;\n  padding: 27rpx 31rpx;\n  left: 0;\n  top: 0;\n}\n\n.a-brand .mt .brand {\n  display: block;\n  font-size: 33rpx;\n  height: 43rpx;\n  color: #333;\n}\n\n.a-brand .mt .price, .a-brand .mt .unit {\n  font-size: 25rpx;\n  color: #999;\n}\n\n.a-brand .item-1 {\n  float: left;\n  width: 375rpx;\n  height: 252rpx;\n  overflow: hidden;\n  border-top: 1rpx solid #fff;\n  margin-left: 1rpx;\n}\n\n.a-brand .item-1:nth-child(2n+1){\n  margin-left: 0;\n  width: 374rpx;\n}\n\n.a-brand .item-1 .img {\n  width: 375rpx;\n  height: 253rpx;\n}\n\n.a-new .b {\n  width: 750rpx;\n  height: auto;\n  overflow: hidden;\n  padding: 0 31rpx 45rpx 31rpx;\n}\n\n.a-new .b .item {\n  float: left;\n  width: 302rpx;\n  margin-top: 10rpx;\n  margin-left: 21rpx;\n  margin-right: 21rpx;\n}\n\n.a-new .b .item-b {\n  margin-left: 42rpx;\n}\n\n.a-new .b .img {\n  width: 302rpx;\n  height: 302rpx;\n}\n\n.a-new .b .name {\n  text-align: center;\n  display: block;\n  width: 302rpx;\n  height: 35rpx;\n  margin-bottom: 14rpx;\n  overflow: hidden;\n  font-size: 30rpx;\n  color: #333;\n}\n\n.a-new .b .price {\n  display: block;\n  text-align: center;\n  line-height: 30rpx;\n  font-size: 30rpx;\n  color: #b4282d;\n}\n\n.a-popular {\n  width: 750rpx;\n  height: auto;\n  overflow: hidden;\n}\n\n.a-popular .b .item {\n  border-top: 1px solid #d9d9d9;\n  margin: 0 20rpx;\n  height: 264rpx;\n  width: 710rpx;\n}\n\n.a-popular .b .img {\n  margin-top: 12rpx;\n  margin-right: 12rpx;\n  float: left;\n  width: 240rpx;\n  height: 240rpx;\n}\n\n.a-popular .b .right {\n  float: left;\n  height: 264rpx;\n  width: 456rpx;\n  display: flex;\n  flex-flow: row nowrap;\n}\n\n.a-popular .b .text {\n  display: flex;\n  flex-wrap: nowrap;\n  flex-direction: column;\n  justify-content: center;\n  overflow: hidden;\n  height: 264rpx;\n  width: 456rpx;\n}\n\n.a-popular .b .name {\n  width: 456rpx;\n  display: block;\n  color: #333;\n  line-height: 50rpx;\n  font-size: 30rpx;\n}\n\n.a-popular .b .desc {\n  width: 456rpx;\n  display: block;\n  color: #999;\n  line-height: 50rpx;\n  font-size: 25rpx;\n}\n\n.a-popular .b .price {\n  width: 456rpx;\n  display: block;\n  color: #b4282d;\n  line-height: 50rpx;\n  font-size: 33rpx;\n}\n\n.a-topic .b {\n  height: 533rpx;\n  width: 750rpx;\n  padding: 0 0 48rpx 0;\n}\n\n.a-topic .b .list {\n  height: 533rpx;\n  width: 750rpx;\n  white-space: nowrap;\n}\n\n.a-topic .b .item {\n  display: inline-block;\n  height: 533rpx;\n  width: 680.5rpx;\n  margin-left: 30rpx;\n  overflow: hidden;\n}\n\n.a-topic .b .item:last-child {\n  margin-right: 30rpx;\n}\n\n.a-topic .b .img {\n  height: 387.5rpx;\n  width: 680.5rpx;\n  margin-bottom: 30rpx;\n}\n\n.a-topic .b .np {\n  height: 35rpx;\n  margin-bottom: 13.5rpx;\n  color: #333;\n  font-size: 30rpx;\n}\n\n.a-topic .b .np .price {\n  margin-left: 20.8rpx;\n  color: #b4282d;\n}\n\n.a-topic .b .desc {\n  display: block;\n  height: 30rpx;\n  color: #999;\n  font-size: 24rpx;\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow:ellipsis;\n}\n\n.good-grid {\n  width: 750rpx;\n  height: auto;\n  overflow: hidden;\n  background: #fff;\n  margin-top: 20rpx;\n}\n\n.good-grid .h {\n  display: flex;\n  flex-flow: row nowrap;\n  align-items: center;\n  justify-content: center;\n  height: 130rpx;\n  font-size: 33rpx;\n  color: #333;\n}\n\n.good-grid .b {\n  width: 750rpx;\n  height: auto;\n  overflow: hidden;\n  padding: 0 20rpx;\n}\n\n.good-grid .b .item {\n  display: block;\n  float: left;\n  width: 345rpx;\n  margin-bottom: 30rpx;\n  height: auto;\n  overflow: hidden;\n  text-align: center;\n}\n\n.good-grid .b .item:nth-child(2n + 1) {\n  margin-right: 20rpx;\n}\n\n.good-grid .item .img {\n  width: 345rpx;\n  height: 345rpx;\n  background: #f8f8f8;\n  margin-bottom: 10rpx;\n}\n\n.good-grid .item .name {\n  width: 100%;\n  overflow: hidden;\n  height: 40rpx;\n  line-height: 40rpx;\n  text-align: center;\n  font-size: 30rpx;\n  color: #333;\n}\n\n.good-grid .item .price {\n  width: 100%;\n  height: 46rpx;\n  line-height: 46rpx;\n  text-align: center;\n  font-size: 30rpx;\n  color: #b4282d;\n}\n"
  },
  {
    "path": "pages/logs/logs.js",
    "content": "//logs.js\nvar util = require('../../utils/util.js')\nPage({\n  data: {\n    logs: []\n  },\n  onLoad: function () {\n    this.setData({\n      logs: (wx.getStorageSync('logs') || []).map(function (log) {\n        return util.formatTime(new Date(log))\n      })\n    })\n  }\n})\n"
  },
  {
    "path": "pages/logs/logs.json",
    "content": "{\n    \"navigationBarTitleText\": \"查看启动日志\"\n}"
  },
  {
    "path": "pages/logs/logs.wxml",
    "content": "<!--logs.wxml-->\n<view class=\"container log-list\">\n  <block wx:for=\"{{logs}}\" wx:for-item=\"log\">\n    <text class=\"log-item\">{{index + 1}}. {{log}}</text>\n  </block>\n</view>\n"
  },
  {
    "path": "pages/logs/logs.wxss",
    "content": ".log-list {\n  display: flex;\n  flex-direction: column;\n  padding: 40rpx;\n}\n.log-item {\n  margin: 10rpx;\n}\n"
  },
  {
    "path": "pages/newGoods/newGoods.js",
    "content": "var util = require('../../utils/util.js');\nvar api = require('../../config/api.js');\nvar app = getApp();\n\nPage({\n  data: {\n    bannerInfo: {\n      'img_url': '',\n      'name': ''\n    },\n    categoryFilter: false,\n    filterCategory: [],\n    goodsList: [],\n    categoryId: 0,\n    currentSortType: 'default',\n    currentSortOrder: 'desc',\n    page: 1,\n    size: 1000\n  },\n  getData: function () {\n    let that = this;\n    util.request(api.GoodsHot).then(function (res) {\n      if (res.errno === 0) {\n        that.setData({\n          bannerInfo: res.data.bannerInfo,\n        });\n        that.getGoodsList();\n      }\n    });\n  },\n  getGoodsList() {\n    var that = this;\n\n    util.request(api.GoodsList, { isNew: 1, page: that.data.page, size: that.data.size, order: that.data.currentSortOrder, sort: that.data.currentSortType, categoryId: that.data.categoryId })\n      .then(function (res) {\n        if (res.errno === 0) {\n          that.setData({\n            goodsList: res.data.goodsList,\n            filterCategory: res.data.filterCategory\n          });\n        }\n      });\n  },\n  onLoad: function (options) {\n    // 页面初始化 options为页面跳转所带来的参数\n    this.getData();\n  },\n  onReady: function () {\n    // 页面渲染完成\n  },\n  onShow: function () {\n    // 页面显示\n\n  },\n  onHide: function () {\n    // 页面隐藏\n\n  },\n  onUnload: function () {\n    // 页面关闭\n\n  },\n  openSortFilter: function (event) {\n    let currentId = event.currentTarget.id;\n    switch (currentId) {\n      case 'categoryFilter':\n        this.setData({\n          'categoryFilter': !this.data.categoryFilter,\n          'currentSortType': 'category',\n          'currentSortOrder': 'asc'\n        });\n        break;\n      case 'priceSort':\n        let tmpSortOrder = 'asc';\n        if (this.data.currentSortOrder == 'asc') {\n          tmpSortOrder = 'desc';\n        }\n        this.setData({\n          'currentSortType': 'price',\n          'currentSortOrder': tmpSortOrder,\n          'categoryFilter': false\n        });\n\n        this.getData();\n        break;\n      default:\n        //综合排序\n        this.setData({\n          'currentSortType': 'default',\n          'currentSortOrder': 'desc',\n          'categoryFilter': false\n        });\n        this.getData();\n    }\n  },\n  selectCategory: function (event) {\n    let currentIndex = event.target.dataset.categoryIndex;\n    this.setData({\n      'categoryFilter': false,\n      'categoryId': this.data.filterCategory[currentIndex].id\n    });\n    this.getData();\n\n  }\n})"
  },
  {
    "path": "pages/newGoods/newGoods.json",
    "content": "{\n    \n}"
  },
  {
    "path": "pages/newGoods/newGoods.wxml",
    "content": "<view class=\"container\">\n  <view class=\"brand-info\">\n    <view class=\"name\">\n      <image class=\"img\" src=\"{{bannerInfo.img_url}}\" background-size=\"cover\"></image>\n      <view class=\"info-box\">\n        <view class=\"info\">\n          <text class=\"txt\">{{bannerInfo.name}}</text>\n          <text class=\"line\"></text>\n        </view>\n      </view>\n    </view>\n  </view>\n  <view class=\"sort\">\n    <view class=\"sort-box\">\n      <view class=\"item {{currentSortType == 'default' ? 'active' : ''}}\"  bindtap=\"openSortFilter\" id=\"defaultSort\">\n        <text class=\"txt\">综合</text>\n      </view>\n      <view class=\"item by-price {{currentSortType == 'price' ? 'active' : ''}} {{currentSortOrder == 'asc'  ? 'asc' : 'desc'}}\" bindtap=\"openSortFilter\" id=\"priceSort\">\n        <text class=\"txt\">价格</text>\n      </view>\n      <view class=\"item {{currentSortType == 'category' ? 'active' : ''}}\" bindtap=\"openSortFilter\" id=\"categoryFilter\">\n        <text class=\"txt\">分类</text>\n      </view>\n    </view>\n    <view class=\"sort-box-category\" wx-if=\"{{categoryFilter}}\">\n      <view class=\"item {{item.checked ? 'active' : ''}}\" wx:for=\"{{filterCategory}}\" wx:key=\"cate-{{item.id}}\" data-category-index=\"{{index}}\" bindtap=\"selectCategory\">{{item.name}}</view>\n    </view>\n  </view>\n  <view class=\"cate-item\">\n    <view class=\"b\">\n      <block wx:for=\"{{goodsList}}\" wx:for-index=\"iindex\" wx:for-item=\"iitem\" wx:key=\"unique\">\n        <navigator class=\"item {{iindex % 2 == 0 ? 'item-b' : '' }}\" url=\"../goods/goods?id={{iitem.id}}\">\n          <image class=\"img\" src=\"{{iitem.list_pic_url}}\" background-size=\"cover\"></image>\n          <text class=\"name\">{{iitem.name}}</text>\n          <text class=\"price\">￥{{iitem.retail_price}}</text>\n        </navigator>\n      </block>\n    </view>\n  </view>\n</view>"
  },
  {
    "path": "pages/newGoods/newGoods.wxss",
    "content": "page{\n    background: #f4f4f4;\n}\n\n.brand-info .name{\n    width: 100%;\n    height: 278rpx;\n    position: relative;\n}\n\n.brand-info .img{\n    position: absolute;\n    top:0;\n    left:0;\n    width: 100%;\n    height: 278rpx;\n}\n\n.brand-info .info-box{\n    position: absolute;\n    top:0;\n    left:0;\n    width: 100%;\n    height: 278rpx;\n    text-align: center;\n    display: flex;\n    justify-content: center;\n    align-items: center;\n}\n\n.brand-info .info{\n    display: block;\n}\n\n.brand-info .txt{\n    display: block;\n    height: 40rpx;\n    font-size: 37.5rpx;\n    color: #fff;\n}\n\n.brand-info .line{\n    margin: 0 auto;\n    margin-top: 16rpx;\n    display: block;\n    height: 2rpx;\n    width: 145rpx;\n    background: #fff;\n}\n\n.sort{\n    position: relative;\n    background: #fff;\n    width: 100%;\n    height: 78rpx;\n}\n\n.sort-box{\n    background: #fff;\n    width: 100%;\n    height: 78rpx;\n    overflow: hidden;\n    padding: 0 30rpx;\n    display: flex;\n    border-bottom: 1px solid #d9d9d9;\n}\n\n.sort-box .item{\n    height: 78rpx;\n    line-height: 78rpx;\n    text-align: center;\n    flex:1;\n    color: #333;\n    font-size: 30rpx;\n}\n\n.sort-box .item .txt{\n    display: block;\n    width: 100%;\n    height: 100%;\n    color: #333;\n}\n\n.sort-box .item.active .txt{\n    color: #b4282d;\n}\n\n.sort-box .item.by-price{\n    background: url(//yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/no-3127092a69.png) 155rpx center no-repeat;\n    background-size: 15rpx 21rpx;\n}\n\n.sort-box .item.by-price.active.asc{\n    background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/up-636b92c0a5.png) 155rpx center no-repeat;\n    background-size: 15rpx 21rpx;\n}\n\n.sort-box .item.by-price.active.desc{\n    background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/down-95e035f3e5.png) 155rpx center no-repeat;\n    background-size: 15rpx 21rpx;\n}\n\n.sort-box-category{\n    background: #fff;\n    width: 100%;\n    height: auto;\n    overflow: hidden;\n    padding: 40rpx 40rpx 0 0;\n    border-bottom: 1px solid #d9d9d9;\n}\n\n.sort-box-category .item{\n    height: 54rpx;\n    line-height: 54rpx;\n    text-align: center;\n    float: left;\n    padding: 0 16rpx;\n    margin: 0 0 40rpx 40rpx;\n    border: 1px solid #666;\n    color: #333;\n    font-size: 24rpx;\n}\n\n.sort-box-category .item.active{\n    color: #b4282d;\n    border: 1px solid #b4282d;\n}\n\n.cate-item .b{\n  width: 750rpx;\n  height: auto;\n  overflow: hidden;\n  border-top: 1rpx solid #f4f4f4;\n  margin-top: 20rpx;\n}\n\n.cate-item .b .item{\n  float: left;\n  background: #fff;\n  width: 375rpx;\n  padding-bottom: 33.333rpx;\n  border-bottom: 1rpx solid #f4f4f4;\n  height: auto;\n  overflow: hidden;\n  text-align: center;\n}\n\n.cate-item .b .item-b{\n border-right: 1rpx solid #f4f4f4;\n}\n\n.cate-item .item .img{\n    margin-top: 10rpx;\n  width: 302rpx;\n  height: 302rpx;\n}\n\n.cate-item .item .name{\n  display: block;\n  width: 365.625rpx;\n  height: 35rpx;\n  padding: 0 20rpx;\n  overflow: hidden;\n  margin: 11.5rpx 0 22rpx 0;\n  text-align: center;\n  font-size: 30rpx;\n  color: #333;\n}\n\n.cate-item .item .price{\n  display: block;\n  width: 365.625rpx;\n  height: 30rpx;\n  text-align: center;\n  font-size: 30rpx;\n  color: #b4282d;\n}"
  },
  {
    "path": "pages/pay/pay.js",
    "content": "var app = getApp();\nvar util = require('../../utils/util.js');\nvar api = require('../../config/api.js');\n\nPage({\n  data: {\n    orderId: 0,\n    actualPrice: 0.00\n  },\n  onLoad: function (options) {\n    // 页面初始化 options为页面跳转所带来的参数\n    this.setData({\n      orderId: options.orderId,\n      actualPrice: options.actualPrice\n    })\n  },\n  onReady: function () {\n\n  },\n  onShow: function () {\n    // 页面显示\n\n  },\n  onHide: function () {\n    // 页面隐藏\n\n  },\n  onUnload: function () {\n    // 页面关闭\n\n  },\n  //向服务请求支付参数\n  requestPayParam() {\n    let that = this;\n    util.request(api.PayPrepayId, { orderId: that.data.orderId, payType: 1 }).then(function (res) {\n      if (res.errno === 0) {\n        let payParam = res.data;\n        wx.requestPayment({\n          'timeStamp': payParam.timeStamp,\n          'nonceStr': payParam.timeStamp,\n          'package': payParam.nonceStr,\n          'signType': payParam.signType,\n          'paySign': payParam.paySign,\n          'success': function (res) {\n            wx.redirectTo({\n              url: '/pages/payResult/payResult?status=true',\n            })\n          },\n          'fail': function (res) {\n            wx.redirectTo({\n              url: '/pages/payResult/payResult?status=false',\n            })\n          }\n        })\n      }\n    });\n  },\n  startPay() {\n    this.requestPayParam();\n  }\n})"
  },
  {
    "path": "pages/pay/pay.json",
    "content": "{\n  \"navigationBarTitleText\": \"支付订单\"\n}"
  },
  {
    "path": "pages/pay/pay.wxml",
    "content": "<view class=\"container\">\n    <view class=\"total\">\n      <view class=\"label\">订单金额</view>\n      <view class=\"txt\">{{actualPrice}}元</view>\n    </view>\n    <view class=\"pay-list\">\n        <view class=\"h\">请选择支付方式</view>\n        <view class=\"b\">\n            <!--<view class=\"item\">\n                <view class=\"checkbox checked\"></view>\n                <view class=\"icon-alipay\"></view>\n                <view class=\"name\">支付宝</view>\n            </view>\n            <view class=\"item\">\n                <view class=\"checkbox\"></view>\n                <view class=\"icon-net\"></view>\n                <view class=\"name\">网易支付</view>\n            </view>-->\n            <view class=\"item\">\n                <view class=\"checkbox checked\"></view>\n                <image src=\"/static/images/wxpay.png\" class=\"icon\"></image>\n                <view class=\"name\">微信支付</view>\n            </view>\n        </view>\n    </view>\n    <view class=\"tips\">小程序只支持微信支付，如需其它支付方式，请在网页版支付</view>\n\n    <view class=\"pay-btn\" bindtap=\"startPay\">确定</view>\n</view>"
  },
  {
    "path": "pages/pay/pay.wxss",
    "content": "page{\n    min-height: 100%;\n    width: 100%;\n    background: #f4f4f4;\n}\n\n.container{\n  padding-top: 20rpx;\n}\n\n.total{\n  height: 104rpx;\n  background: #fff;\n  width: 100%;\n  line-height: 104rpx;\n  padding-left: 30rpx;\n  padding-right: 30rpx;\n}\n\n.total .label{\n  float: left;\n}\n\n.total .txt{\n  float: right;\n}\n\n.pay-list{\n    margin-top: 30rpx;\n    height: auto;\n    width: 100%;\n    overflow: hidden;\n}\n.pay-list .h{\n    width: 100%;\n    height: 24rpx;\n    line-height: 24rpx;\n    margin-left: 31.25rpx;\n    margin-bottom: 31.25rpx;\n}\n\n.pay-list .item{\n    height: 108rpx;\n    padding-left: 31.25rpx;\n    background: #fff;\n    display: flex;\n    align-items: center;\n    border-bottom: 1px solid #f4f4f4;\n}\n\n.pay-list .checkbox{\n    background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/checkbox-sed825af9d3-a6b8540d42.png) 0 -448rpx no-repeat;\n    background-size: 38rpx 486rpx;\n    width: 40rpx;\n    height: 40rpx;\n    display: inline-block;\n    vertical-align: middle;\n    margin-right: 30rpx;\n}\n\n.pay-list .checkbox.checked{\n    background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/checkbox-sed825af9d3-a6b8540d42.png) 0 -192rpx no-repeat;\n    background-size: 38rpx 486rpx;\n}\n\n.pay-list .icon-alipay{\n    display: inline-block;\n    vertical-align: middle;\n    background-image: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/payMethod-s3c1faebee4-d754da9c65.png);\n    background-repeat: no-repeat;\n    background-size: 56.25rpx 189.583rpx;\n    margin-right: 10.5rpx;\n    width: 56.25rpx;\n    height: 56.25rpx;\n}\n\n.pay-list .icon-net{\n    display: inline-block;\n    vertical-align: middle;\n    background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/payMethod-s3c1faebee4-d754da9c65.png) 0 -66.7rpx no-repeat;\n    background-size: 56.25rpx 189.583rpx;\n    margin-right: 10.5rpx;\n    width: 56.25rpx;\n    height: 56.25rpx;\n}\n\n.pay-list .icon{\n    display: inline-block;\n    vertical-align: middle;\n    margin-right: 10.5rpx;\n    width: 56.25rpx;\n    height: 56.25rpx;\n}\n\n.pay-list .name{\n    display: inline-block;\n    vertical-align: middle;\n    height: 56.25rpx;\n    line-height: 56.25rpx;\n}\n\n.pay-btn{\n    position: fixed;\n    left: 0;\n    bottom: 0;\n    height: 100rpx;\n    width: 100%;\n    text-align: center;\n    line-height: 100rpx;\n    background: #b4282d;\n    color: #fff;\n    font-size: 30rpx;\n}\n\n.tips{\n  height: 40rpx;\n  width: 100%;\n  font-size: 24rpx;\n  color: #999;\n  line-height: 40rpx;\n  padding-left: 30rpx;\n  padding-right: 30rpx;\n}"
  },
  {
    "path": "pages/payResult/payResult.js",
    "content": "var util = require('../../utils/util.js');\nvar api = require('../../config/api.js');\nconst pay = require('../../services/pay.js');\n\nvar app = getApp();\nPage({\n  data: {\n    status: false,\n    orderId: 0\n  },\n  onLoad: function (options) {\n    // 页面初始化 options为页面跳转所带来的参数\n    this.setData({\n      orderId: options.orderId || 24,\n      status: options.status\n    })\n  },\n  onReady: function () {\n\n  },\n  onShow: function () {\n    // 页面显示\n\n  },\n  onHide: function () {\n    // 页面隐藏\n\n  },\n  onUnload: function () {\n    // 页面关闭\n\n  },\n  payOrder() {\n    pay.payOrder(parseInt(this.data.orderId)).then(res => {\n      this.setData({\n        status: true\n      });\n    }).catch(res => {\n      util.showErrorToast('支付失败');\n    });\n  }\n})"
  },
  {
    "path": "pages/payResult/payResult.json",
    "content": "{\n    \"navigationBarTitleText\": \"付款结果\",\n    \"navigationBarBackgroundColor\": \"#fafafa\"\n}"
  },
  {
    "path": "pages/payResult/payResult.wxml",
    "content": "<view class=\"container\">\n  <view class=\"pay-result\">\n    <view class=\"success\" wx:if=\"{{status == true}}\">\n      <view class=\"msg\">付款成功</view>\n      <view class=\"btns\">\n        <navigator class=\"btn\" url=\"/pages/ucenter/order/order\" open-type=\"redirect\">查看订单</navigator>\n        <navigator class=\"btn\" url=\"/pages/index/index\" open-type=\"switchTab\">继续逛</navigator>\n      </view>\n    </view>\n    <view class=\"error\" wx:if=\"{{status != true}}\">\n      <view class=\"msg\">付款失败</view>\n      <view class=\"tips\">\n        <view class=\"p\">请在 <text class=\"time\">1小时</text> 内完成付款</view>\n        <view class=\"p\">否则订单将会被系统取消</view>\n      </view>\n      <view class=\"btns\">\n        <navigator class=\"btn\" url=\"/pages/ucenter/order/order\" open-type=\"redirect\">查看订单</navigator>\n        <view class=\"btn\" bindtap='payOrder'>重新付款</view>\n      </view>\n    </view>\n  </view>\n\n</view>"
  },
  {
    "path": "pages/payResult/payResult.wxss",
    "content": "page {\n  min-height: 100%;\n  width: 100%;\n  background: #fff;\n}\n\n.container {\n  height: 100%;\n  background: #fff;\n}\n\n.pay-result {\n  background: #fff;\n}\n\n.pay-result .msg {\n  text-align: center;\n  margin: 100rpx auto;\n  color: #2bab25;\n  font-size: 36rpx;\n}\n\n.pay-result .btns {\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n.pay-result .btn {\n  text-align: center;\n  height: 80rpx;\n  margin: 0 20rpx;\n  width: 200rpx;\n  line-height: 78rpx;\n  border: 1px solid #868686;\n  color: #000000;\n  border-radius: 5rpx;\n}\n\n.pay-result .error .msg {\n  color: #b4282d;\n  margin-bottom: 60rpx;\n}\n\n.pay-result .error .tips {\n  color: #7f7f7f;\n  margin-bottom: 70rpx;\n}\n\n.pay-result .error .tips .p {\n  font-size: 24rpx;\n  line-height: 42rpx;\n  text-align: center;\n}\n\n.pay-result .error .tips .p {\n  line-height: 42rpx;\n  text-align: center;\n}"
  },
  {
    "path": "pages/search/search.js",
    "content": "var util = require('../../utils/util.js');\nvar api = require('../../config/api.js');\n\nvar app = getApp()\nPage({\n  data: {\n    keywrod: '',\n    searchStatus: false,\n    goodsList: [],\n    helpKeyword: [],\n    historyKeyword: [],\n    categoryFilter: false,\n    currentSortType: 'default',\n    currentSortOrder: '',\n    filterCategory: [],\n    defaultKeyword: {},\n    hotKeyword: [],\n    page: 1,\n    size: 20,\n    currentSortType: 'id',\n    currentSortOrder: 'desc',\n    categoryId: 0\n  },\n  //事件处理函数\n  closeSearch: function () {\n    wx.navigateBack()\n  },\n  clearKeyword: function () {\n    this.setData({\n      keyword: '',\n      searchStatus: false\n    });\n  },\n  onLoad: function () {\n\n    this.getSearchKeyword();\n  },\n\n  getSearchKeyword() {\n    let that = this;\n    util.request(api.SearchIndex).then(function (res) {\n      if (res.errno === 0) {\n        that.setData({\n          historyKeyword: res.data.historyKeywordList,\n          defaultKeyword: res.data.defaultKeyword,\n          hotKeyword: res.data.hotKeywordList\n        });\n      }\n    });\n  },\n\n  inputChange: function (e) {\n\n    this.setData({\n      keyword: e.detail.value,\n      searchStatus: false\n    });\n    this.getHelpKeyword();\n  },\n  getHelpKeyword: function () {\n    let that = this;\n    util.request(api.SearchHelper, { keyword: that.data.keyword }).then(function (res) {\n      if (res.errno === 0) {\n        that.setData({\n          helpKeyword: res.data\n        });\n      }\n    });\n  },\n  inputFocus: function () {\n    this.setData({\n      searchStatus: false,\n      goodsList: []\n    });\n\n    if (this.data.keyword) {\n      this.getHelpKeyword();\n    }\n  },\n  clearHistory: function () {\n    this.setData({\n      historyKeyword: []\n    })\n\n    util.request(api.SearchClearHistory, {}, 'POST')\n      .then(function (res) {\n        console.log('清除成功');\n      });\n  },\n  getGoodsList: function () {\n    let that = this;\n    util.request(api.GoodsList, { keyword: that.data.keyword, page: that.data.page, size: that.data.size, sort: that.data.currentSortType, order: that.data.currentSortOrder, categoryId: that.data.categoryId }).then(function (res) {\n      if (res.errno === 0) {\n        that.setData({\n          searchStatus: true,\n          categoryFilter: false,\n          goodsList: res.data.data,\n          filterCategory: res.data.filterCategory,\n          page: res.data.currentPage,\n          size: res.data.numsPerPage\n        });\n      }\n\n      //重新获取关键词\n      that.getSearchKeyword();\n    });\n  },\n  onKeywordTap: function (event) {\n\n    this.getSearchResult(event.target.dataset.keyword);\n\n  },\n  getSearchResult(keyword) {\n    this.setData({\n      keyword: keyword,\n      page: 1,\n      categoryId: 0,\n      goodsList: []\n    });\n\n    this.getGoodsList();\n  },\n  openSortFilter: function (event) {\n    let currentId = event.currentTarget.id;\n    switch (currentId) {\n      case 'categoryFilter':\n        this.setData({\n          'categoryFilter': !this.data.categoryFilter,\n          'currentSortOrder': 'asc'\n        });\n        break;\n      case 'priceSort':\n        let tmpSortOrder = 'asc';\n        if (this.data.currentSortOrder == 'asc') {\n          tmpSortOrder = 'desc';\n        }\n        this.setData({\n          'currentSortType': 'price',\n          'currentSortOrder': tmpSortOrder,\n          'categoryFilter': false\n        });\n\n        this.getGoodsList();\n        break;\n      default:\n        //综合排序\n        this.setData({\n          'currentSortType': 'default',\n          'currentSortOrder': 'desc',\n          'categoryFilter': false\n        });\n        this.getGoodsList();\n    }\n  },\n  selectCategory: function (event) {\n    let currentIndex = event.target.dataset.categoryIndex;\n    let filterCategory = this.data.filterCategory;\n    let currentCategory = null;\n    for (let key in filterCategory) {\n      if (key == currentIndex) {\n        filterCategory[key].selected = true;\n        currentCategory = filterCategory[key];\n      } else {\n        filterCategory[key].selected = false;\n      }\n    }\n    this.setData({\n      'filterCategory': filterCategory,\n      'categoryFilter': false,\n      categoryId: currentCategory.id,\n      page: 1,\n      goodsList: []\n    });\n    this.getGoodsList();\n  },\n  onKeywordConfirm(event) {\n    this.getSearchResult(event.detail.value);\n  }\n})"
  },
  {
    "path": "pages/search/search.json",
    "content": "{\n    \n}"
  },
  {
    "path": "pages/search/search.wxml",
    "content": "<scroll-view class=\"container\" style=\"height: 100%;\">\n  <view class=\"search-header\">\n    <view class=\"input-box\">\n      <image class=\"icon\" src=\"http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/search2-2fb94833aa.png\"></image>\n      <input name=\"input\" class=\"keywrod\" focus=\"true\" value=\"{{keyword}}\" confirm-type=\"search\" bindinput=\"inputChange\" bindfocus=\"inputFocus\" bindconfirm=\"onKeywordConfirm\" confirm-type=\"search\" placeholder=\"{{defaultKeyword.keyword}}\" />\n      <image class=\"del\" wx:if=\"{{keyword}}\" bindtap=\"clearKeyword\" src=\"http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/clearIpt-f71b83e3c2.png\"></image>\n    </view>\n    <view class=\"right\" bindtap=\"closeSearch\">取消</view>\n  </view>\n  <view class=\"no-search\" wx:if=\"{{ !searchStatus}}\">\n      <view class=\"serach-keywords search-history\" wx:if=\"{{!keyword  && historyKeyword.length}}\">\n    <view class=\"h\">\n      <text class=\"title\">历史记录</text>\n      <image class=\"icon\" bindtap=\"clearHistory\" src=\"http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/del1-93f0a4add4.png\"></image>\n    </view>\n    <view class=\"b\">\n      <view class=\"item\" bindtap=\"onKeywordTap\" data-keyword=\"{{item}}\" wx:for=\"{{historyKeyword}}\" hover-class=\"navigator-hover\">{{item}}</view>\n    </view>\n  </view>\n  <view class=\"serach-keywords search-hot\" wx:if=\"{{!keyword}}\">\n    <view class=\"h\">\n      <text class=\"title\">热门搜索</text>\n    </view>\n    <view class=\"b\">\n      <view class=\"item {{item.is_hot === 1 ? 'active' : ''}}\" hover-class=\"navigator-hover\" bindtap=\"onKeywordTap\" data-keyword=\"{{item.keyword}}\" wx:for=\"{{hotKeyword}}\">{{item.keyword}}</view>\n    </view>\n  </view>\n  <view class=\"shelper-list\" wx:if=\"{{keyword}}\">\n    <view class=\"item\" hover-class=\"navigator-hover\" wx:for=\"{{helpKeyword}}\" bindtap=\"onKeywordTap\" data-keyword=\"{{item}}\">{{item}}</view>\n  </view>\n  </view>\n\n  <view class=\"search-result\" wx:if=\"{{ searchStatus && goodsList.length}}\">\n    <view class=\"sort\">\n    <view class=\"sort-box\">\n      <view class=\"item {{currentSortType == 'default' ? 'active' : ''}}\" bindtap=\"openSortFilter\" id=\"defaultSort\">\n        <text class=\"txt\">综合</text>\n      </view>\n      <view class=\"item by-price {{currentSortType == 'price' ? 'active' : ''}} {{currentSortOrder == 'asc'  ? 'asc' : 'desc'}}\" bindtap=\"openSortFilter\" id=\"priceSort\">\n        <text class=\"txt\">价格</text>\n      </view>\n      <view class=\"item {{currentSortType == 'category' ? 'active' : ''}}\" bindtap=\"openSortFilter\" id=\"categoryFilter\">\n        <text class=\"txt\">分类</text>\n      </view>\n    </view>\n    <view class=\"sort-box-category\" wx-if=\"{{categoryFilter}}\">\n      <view class=\"item {{item.checked ? 'active' : ''}}\" wx:for=\"{{filterCategory}}\" wx:key=\"cate-{{item.id}}\" data-category-index=\"{{index}}\" bindtap=\"selectCategory\">{{item.name}}</view>\n    </view>\n  </view>\n  <view class=\"cate-item\">\n    <view class=\"b\">\n      <navigator class=\"item {{(iindex + 1) % 2 == 0 ? 'item-b' : ''}}\" url=\"/pages/goods/goods?id={{iitem.id}}\" wx:for=\"{{goodsList}}\" wx:for-item=\"iitem\" wx:for-index=\"iindex\">\n        <image class=\"img\" src=\"{{iitem.list_pic_url}}\" background-size=\"cover\"></image>\n        <text class=\"name\">{{iitem.name}}</text>\n        <text class=\"price\">￥{{iitem.retail_price}}</text>\n      </navigator>\n    </view>\n  </view>\n  </view>\n\n  <view class=\"search-result-empty\" wx:if=\"{{!goodsList.length && searchStatus}}\">\n    <image class=\"icon\" src=\"http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/noSearchResult-7572a94f32.png\"></image>\n    <text class=\"text\">您寻找的商品还未上架</text>\n  </view>\n</scroll-view>"
  },
  {
    "path": "pages/search/search.wxss",
    "content": "page{\n  min-height: 100%;\n  background-color: #f4f4f4;\n}\n\n.container{\n  min-height: 100%;\n  background-color: #f4f4f4;\n}\n\n.search-header{\n    position: fixed;\n    top: 0;\n    width: 750rpx;\n    height: 91rpx;\n    display: flex;\n    background: #fff;\n    border-bottom: 1px solid rgba(0,0,0,.15);\n    padding: 0 31.25rpx;\n    font-size: 29rpx;\n    color: #333;\n}\n\n.search-header .input-box{\n    position: relative;\n    margin-top: 16rpx;\n    float: left;\n    width: 0;\n    flex: 1;\n    height: 59rpx;\n    line-height: 59rpx;\n    padding: 0 20rpx;\n    background: #f4f4f4;\n}\n\n.search-header .icon{\n    position: absolute;\n    top: 14rpx;\n    left: 20rpx;\n    width: 31rpx;\n    height: 31rpx;\n}\n\n.search-header .del{\n    position: absolute;\n    top: 3rpx;\n    right: 10rpx;\n    width: 53rpx;\n    height: 53rpx;\n    z-index: 10;\n}\n\n.search-header .keywrod{\n    position: absolute;\n    top: 0;\n    left: 40rpx;\n    width: 506rpx;\n    height: 59rpx;\n    padding-left: 30rpx;\n}\n\n.search-header .right{\n    margin-top: 24rpx;\n    margin-left: 31rpx;\n    margin-right: 6rpx;\n    width: 58rpx;\n    height: 43rpx;\n    line-height: 43rpx;\n    float: right;\n}\n\n.no-search{\n    height: auto;\n    overflow: hidden;\n    margin-top: 91rpx;\n}\n\n.serach-keywords{\n    background: #fff;\n    width: 750rpx;\n    height: auto;\n    overflow: hidden;\n    margin-bottom: 20rpx;\n}\n\n.serach-keywords .h{\n    padding: 0 31.25rpx;\n    height: 93rpx;\n    line-height: 93rpx;\n    width: 100%;\n    color: #999;\n    font-size: 29rpx;\n}\n\n.serach-keywords .title{\n    display: block;\n    width: 120rpx;\n    float: left;\n}\n\n.serach-keywords .icon{\n    margin-top: 19rpx;\n    float: right;\n    display: block;\n    margin-left: 511rpx;\n    height: 55rpx;\n    width: 55rpx;\n}\n\n.serach-keywords .b{\n    width: 750rpx;\n    height: auto;\n    overflow: hidden;\n    padding-left: 31.25rpx;\n}\n\n.serach-keywords .item{\n    display: inline-block;\n    width: auto;\n    height: 48rpx;\n    line-height: 48rpx;\n    padding:0 15rpx;\n    border: 1px solid #999;\n    margin: 0 31.25rpx 31.25rpx 0;\n    font-size: 24rpx;\n    color: #333;\n}\n\n.serach-keywords .item.active{\n    color: #b4282d;\n    border: 1px solid #b4282d;\n}\n\n.shelper-list{\n    width: 750rpx;\n    height: auto;\n    overflow: hidden;\n    background: #fff;\n    padding: 0 31.25rpx;\n}\n\n.shelper-list .item{\n    height: 93rpx;\n    width: 687.5rpx;\n    line-height: 93rpx;\n    font-size: 24rpx;\n    color: #333;\n    border-bottom: 1px solid #f4f4f4;\n}\n\n\n.sort{\n    position: fixed;\n    top: 91rpx;\n    background: #fff;\n    width: 100%;\n    height: 78rpx;\n}\n\n.sort-box{\n    background: #fff;\n    width: 100%;\n    height: 78rpx;\n    overflow: hidden;\n    padding: 0 30rpx;\n    display: flex;\n    border-bottom: 1px solid #d9d9d9;\n}\n\n.sort-box .item{\n    height: 78rpx;\n    line-height: 78rpx;\n    text-align: center;\n    flex:1;\n    color: #333;\n    font-size: 30rpx;\n}\n\n.sort-box .item .txt{\n    display: block;\n    width: 100%;\n    height: 100%;\n    color: #333;\n}\n\n.sort-box .item.active .txt{\n    color: #b4282d;\n}\n\n.sort-box .item.by-price{\n    background: url(//yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/no-3127092a69.png) 155rpx center no-repeat;\n    background-size: 15rpx 21rpx;\n}\n\n.sort-box .item.by-price.active.asc{\n    background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/up-636b92c0a5.png) 155rpx center no-repeat;\n    background-size: 15rpx 21rpx;\n}\n\n.sort-box .item.by-price.active.desc{\n    background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/down-95e035f3e5.png) 155rpx center no-repeat;\n    background-size: 15rpx 21rpx;\n}\n\n.sort-box-category{\n    background: #fff;\n    width: 100%;\n    height: auto;\n    overflow: hidden;\n    padding: 40rpx 40rpx 0 0;\n    border-bottom: 1px solid #d9d9d9;\n}\n\n.sort-box-category .item{\n    height: 54rpx;\n    line-height: 54rpx;\n    text-align: center;\n    float: left;\n    padding: 0 16rpx;\n    margin: 0 0 40rpx 40rpx;\n    border: 1px solid #666;\n    color: #333;\n    font-size: 24rpx;\n}\n\n.sort-box-category .item.active{\n    color: #b4282d;\n    border: 1px solid #b4282d;\n}\n\n.cate-item{\n    margin-top: 175rpx;\n    height: auto;\n    overflow: hidden;\n}\n\n.cate-item .h{\n    height: 145rpx;\n    width: 750rpx;\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n}\n\n.cate-item .h .name{\n    display: block;\n    height: 35rpx;\n    margin-bottom: 18rpx;\n    font-size: 30rpx;\n    color: #333;\n}\n\n.cate-item .h .desc{\n    display: block;\n    height: 24rpx;\n    font-size: 24rpx;\n    color: #999;\n}\n\n.cate-item .b{\n  width: 750rpx;\n  padding: 0 6.25rpx;\n  height: auto;\n  overflow: hidden;\n}\n\n.cate-item .list-filter{\n    height: 80rpx;\n    width: 100%;\n    background: #fff;\n    margin-bottom: 6.25rpx;\n}\n\n.cate-item .b .item{\n  float: left;\n  background: #fff;\n  width: 365rpx;\n  margin-bottom: 6.25rpx;\n  padding-bottom: 33.333rpx;\n  height: auto;\n  overflow: hidden;\n  text-align: center;\n}\n\n.cate-item .b .item-b{\n  margin-left: 6.25rpx;\n}\n\n.cate-item .item .img{\n  width: 302rpx;\n  height: 302rpx;\n}\n\n.cate-item .item .name{\n  display: block;\n  width: 365.625rpx;\n  height: 35rpx;\n  margin: 11.5rpx 0 22rpx 0;\n  text-align: center;\n  overflow: hidden;\n  padding: 0 20rpx;\n  font-size: 30rpx;\n  color: #333;\n}\n\n.cate-item .item .price{\n  display: block;\n  width: 365.625rpx;\n  height: 30rpx;\n  text-align: center;\n  font-size: 30rpx;\n  color: #b4282d;\n}\n\n.search-result-empty{\n    width: 100%;\n    height: 100%;\n    padding-top: 300rpx;\n}\n\n.search-result-empty .icon{\n    margin: 0 auto;\n    display: block;\n    width: 240rpx;\n    height: 240rpx;\n}\n\n.search-result-empty .text{\n    display: block;\n    width: 100%;\n    height: 40rpx;\n    font-size: 28rpx;\n    text-align: center;\n    color: #999;\n}"
  },
  {
    "path": "pages/shopping/address/address.js",
    "content": "var util = require('../../../utils/util.js');\nvar api = require('../../../config/api.js');\nvar app = getApp();\n\nPage({\n  data: {\n    addressList: [],\n  },\n  onLoad: function (options) {\n    // 页面初始化 options为页面跳转所带来的参数\n    this.getAddressList();\n  },\n  onReady: function () {\n    // 页面渲染完成\n  },\n  onShow: function () {\n    // 页面显示\n\n  },\n  getAddressList (){\n    let that = this;\n    util.request(api.AddressList).then(function (res) {\n      if (res.errno === 0) {\n        that.setData({\n          addressList: res.data\n        });\n      }\n    });\n  },\n  addressAddOrUpdate (event) {\n    console.log(event)\n    wx.navigateTo({\n      url: '/pages/shopping/addressAdd/addressAdd?id=' + event.currentTarget.dataset.addressId\n    })\n  },\n  selectAddress(event){\n    console.log(event.currentTarget.dataset.addressId);\n\n    try {\n      wx.setStorageSync('addressId', event.currentTarget.dataset.addressId);\n    } catch (e) {\n\n    }\n\n    //选择该收货地址\n    wx.redirectTo({\n      url: '/pages/shopping/checkout/checkout'\n    })\n  },\n  onHide: function () {\n    // 页面隐藏\n  },\n  onUnload: function () {\n    // 页面关闭\n  }\n})"
  },
  {
    "path": "pages/shopping/address/address.json",
    "content": "{}"
  },
  {
    "path": "pages/shopping/address/address.wxml",
    "content": "<view class=\"container\">\n    <view class=\"address-list\" wx:if=\"{{ addressList.length > 0 }}\">\n        <view class=\"item\" wx:for=\"{{addressList}}\" wx:key=\"{{item.id}}\" bindtap=\"selectAddress\" data-address-id=\"{{item.id}}\">\n            <view class=\"l\">\n                <view class=\"name\">{{item.name}}</view>\n                <view class=\"default\" wx:if=\"{{item.is_default}}\">默认</view>\n            </view>\n            <view class=\"c\">\n                <view class=\"mobile\">{{item.mobile}}</view>\n                <view class=\"address\">{{item.full_region + item.address}}</view>\n            </view>\n            <view class=\"r\">\n                <image catchtap=\"addressAddOrUpdate\" data-address-id=\"{{item.id}}\" class=\"del\" src=\"http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/address-edit-7fee7b0d63.png\"></image>\n            </view>\n        </view>\n    </view>\n    <view class=\"empty-view\" wx:if=\"{{ addressList.length <= 0 }}\">\n      <image class=\"icon\" src=\"http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/noAddress-26d570cefa.png\"></image>\n      <text class=\"text\">收货地址在哪里</text>\n    </view>\n    <view class=\"add-address\" bindtap=\"addressAddOrUpdate\" data-address-id=\"0\">新建</view>\n</view>\n"
  },
  {
    "path": "pages/shopping/address/address.wxss",
    "content": "page{\n    height: 100%;\n    width: 100%;\n    background: #f4f4f4;\n}\n\n.container{\n  height: 100%;\n  width: 100%;\n}\n\n.address-list{\n    padding-left: 31.25rpx;\n    background: #fff url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/address-bg-bd30f2bfeb.png) 0 0 repeat-x;\n    background-size: auto 10.5rpx;\n    margin-bottom: 90rpx;\n}\n\n.address-list .item{\n    height: 156.55rpx;\n    align-items: center;\n    display: flex;\n    border-bottom: 1rpx solid #DCD9D9;\n}\n\n.address-list .item:last-child{\n\n    border-bottom: none;\n}\n\n.address-list .l{\n    width: 125rpx;\n    height: 80rpx;\n    overflow: hidden;\n}\n\n.address-list .name{\n    width: 125rpx;\n    height: 43rpx;\n    font-size: 29rpx;\n    color: #333;\n    margin-bottom: 5.2rpx;\n        text-overflow: ellipsis;\n    white-space: nowrap;\n    overflow: hidden;\n}\n\n.address-list .default{\n    width: 62.5rpx;\n    height: 33rpx;\n    line-height: 28rpx;\n    text-align: center;\n    font-size: 20rpx;\n    color: #b4282d;\n    border: 1rpx solid #b4282d;\n    visibility: visible;\n}\n\n\n.address-list .c{\n    flex: 1;\n    height: auto;\n    overflow: hidden;\n}\n\n.address-list .mobile{\n\n    height: 29rpx;\n    font-size: 29rpx;\n    line-height: 29rpx;\n    overflow: hidden;\n    color: #333;\n    margin-bottom: 6.25rpx;\n}\n\n.address-list .address{\n    height: 37rpx;\n    font-size: 25rpx;\n    line-height: 37rpx;\n    overflow: hidden;\n    color: #666;\n}\n\n.address-list .r{\n    width: 52rpx;\n    height: auto;\n    overflow: hidden;\n    margin-right: 16.5rpx;\n}\n\n.address-list .del{\n    display: block;\n    width: 52rpx;\n    height: 52rpx;\n}\n\n.add-address{\n    background: #b4282d;\n    text-align: center;\n    width: 100%;\n    height: 99rpx;\n    line-height: 99rpx;\n    position: fixed;\n    border-radius: 0;\n    border: none;\n    color: #fff;\n    font-size: 29rpx;\n    bottom: 0;\n    left:0;\n}\n\n.empty-view{\n  height: 100%;\n  width: 100%;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n}\n\n.empty-view .icon{\n  height: 248rpx;\n  width: 258rpx;\n  margin-bottom: 10rpx;\n}\n\n.empty-view .text{\n  width: auto;\n  font-size: 28rpx;\n  line-height: 35rpx;\n  color: #999;\n}"
  },
  {
    "path": "pages/shopping/addressAdd/addressAdd.js",
    "content": "var util = require('../../../utils/util.js');\nvar api = require('../../../config/api.js');\nvar app = getApp();\nPage({\n  data: {\n    address: {\n      id:0,\n      province_id: 0,\n      city_id: 0,\n      district_id: 0,\n      address: '',\n      full_region: '',\n      name: '',\n      mobile: '',\n      is_default: 0\n    },\n    addressId: 0,\n    openSelectRegion: false,\n    selectRegionList: [\n      { id: 0, name: '省份', parent_id: 1, type: 1 },\n      { id: 0, name: '城市', parent_id: 1, type: 2 },\n      { id: 0, name: '区县', parent_id: 1, type: 3 }\n    ],\n    regionType: 1,\n    regionList: [],\n    selectRegionDone: false\n  },\n  bindinputMobile(event) {\n    let address = this.data.address;\n    address.mobile = event.detail.value;\n    this.setData({\n      address: address\n    });\n  },\n  bindinputName(event) {\n    let address = this.data.address;\n    address.name = event.detail.value;\n    this.setData({\n      address: address\n    });\n  },\n  bindinputAddress (event){\n    let address = this.data.address;\n    address.address = event.detail.value;\n    this.setData({\n      address: address\n    });\n  },\n  bindIsDefault(){\n    let address = this.data.address;\n    address.is_default = !address.is_default;\n    this.setData({\n      address: address\n    });\n  },\n  getAddressDetail() {\n    let that = this;\n    util.request(api.AddressDetail, { id: that.data.addressId }).then(function (res) {\n      if (res.errno === 0) {\n        that.setData({\n          address: res.data\n        });\n      }\n    });\n  },\n  setRegionDoneStatus() {\n    let that = this;\n    let doneStatus = that.data.selectRegionList.every(item => {\n      return item.id != 0;\n    });\n\n    that.setData({\n      selectRegionDone: doneStatus\n    })\n\n  },\n  chooseRegion() {\n    let that = this;\n    this.setData({\n      openSelectRegion: !this.data.openSelectRegion\n    });\n\n    //设置区域选择数据\n    let address = this.data.address;\n    if (address.province_id > 0 && address.city_id > 0 && address.district_id > 0) {\n      let selectRegionList = this.data.selectRegionList;\n      selectRegionList[0].id = address.province_id;\n      selectRegionList[0].name = address.province_name;\n      selectRegionList[0].parent_id = 1;\n\n      selectRegionList[1].id = address.city_id;\n      selectRegionList[1].name = address.city_name;\n      selectRegionList[1].parent_id = address.province_id;\n\n      selectRegionList[2].id = address.district_id;\n      selectRegionList[2].name = address.district_name;\n      selectRegionList[2].parent_id = address.city_id;\n\n      this.setData({\n        selectRegionList: selectRegionList,\n        regionType: 3\n      });\n\n      this.getRegionList(address.city_id);\n    } else {\n      this.setData({\n        selectRegionList: [\n          { id: 0, name: '省份', parent_id: 1, type: 1 },\n          { id: 0, name: '城市', parent_id: 1, type: 2 },\n          { id: 0, name: '区县', parent_id: 1, type: 3 }\n        ],\n        regionType: 1\n      })\n      this.getRegionList(1);\n    }\n\n    this.setRegionDoneStatus();\n\n  },\n  onLoad: function (options) {\n    // 页面初始化 options为页面跳转所带来的参数\n    console.log(options)\n    if (options.id) {\n      this.setData({\n        addressId: options.id\n      });\n      this.getAddressDetail();\n    }\n\n    this.getRegionList(1);\n\n  },\n  onReady: function () {\n\n  },\n  selectRegionType(event) {\n    let that = this;\n    let regionTypeIndex = event.target.dataset.regionTypeIndex;\n    let selectRegionList = that.data.selectRegionList;\n\n    //判断是否可点击\n    if (regionTypeIndex + 1 == this.data.regionType || (regionTypeIndex - 1 >= 0 && selectRegionList[regionTypeIndex-1].id <= 0)) {\n      return false;\n    }\n\n    this.setData({\n      regionType: regionTypeIndex + 1\n    })\n    \n    let selectRegionItem = selectRegionList[regionTypeIndex];\n\n    this.getRegionList(selectRegionItem.parent_id);\n\n    this.setRegionDoneStatus();\n\n  },\n  selectRegion(event) {\n    let that = this;\n    let regionIndex = event.target.dataset.regionIndex;\n    let regionItem = this.data.regionList[regionIndex];\n    let regionType = regionItem.type;\n    let selectRegionList = this.data.selectRegionList;\n    selectRegionList[regionType - 1] = regionItem;\n\n\n    if (regionType != 3) {\n      this.setData({\n        selectRegionList: selectRegionList,\n        regionType: regionType + 1\n      })\n      this.getRegionList(regionItem.id);\n    } else {\n      this.setData({\n        selectRegionList: selectRegionList\n      })\n    }\n\n    //重置下级区域为空\n    selectRegionList.map((item, index) => {\n      if (index > regionType - 1) {\n        item.id = 0;\n        item.name = index == 1 ? '城市' : '区县';\n        item.parent_id = 0;\n      }\n      return item;\n    });\n\n    this.setData({\n      selectRegionList: selectRegionList\n    })\n\n\n    that.setData({\n      regionList: that.data.regionList.map(item => {\n\n        //标记已选择的\n        if (that.data.regionType == item.type && that.data.selectRegionList[that.data.regionType - 1].id == item.id) {\n          item.selected = true;\n        } else {\n          item.selected = false;\n        }\n\n        return item;\n      })\n    });\n\n    this.setRegionDoneStatus();\n\n  },\n  doneSelectRegion() {\n    if (this.data.selectRegionDone === false) {\n      return false;\n    }\n\n    let address = this.data.address;\n    let selectRegionList = this.data.selectRegionList;\n    address.province_id = selectRegionList[0].id;\n    address.city_id = selectRegionList[1].id;\n    address.district_id = selectRegionList[2].id;\n    address.province_name = selectRegionList[0].name;\n    address.city_name = selectRegionList[1].name;\n    address.district_name = selectRegionList[2].name;\n    address.full_region = selectRegionList.map(item => {\n      return item.name;\n    }).join('');\n\n    this.setData({\n      address: address,\n      openSelectRegion: false\n    });\n\n  },\n  cancelSelectRegion() {\n    this.setData({\n      openSelectRegion: false,\n      regionType: this.data.regionDoneStatus ? 3 : 1\n    });\n\n  },\n  getRegionList(regionId) {\n    let that = this;\n    let regionType = that.data.regionType;\n    util.request(api.RegionList, { parentId: regionId }).then(function (res) {\n      if (res.errno === 0) {\n        that.setData({\n          regionList: res.data.map(item => {\n\n            //标记已选择的\n            if (regionType == item.type && that.data.selectRegionList[regionType - 1].id == item.id) {\n              item.selected = true;\n            } else {\n              item.selected = false;\n            }\n\n            return item;\n          })\n        });\n      }\n    });\n  },\n  cancelAddress(){\n    wx.reLaunch({\n      url: '/pages/shopping/address/address',\n    })\n  },\n  saveAddress(){\n    console.log(this.data.address)\n    let address = this.data.address;\n\n    if (address.name == '') {\n      util.showErrorToast('请输入姓名');\n\n      return false;\n    }\n\n    if (address.mobile == '') {\n      util.showErrorToast('请输入手机号码');\n      return false;\n    }\n\n\n    if (address.district_id == 0) {\n      util.showErrorToast('请输入省市区');\n      return false;\n    }\n\n    if (address.address == '') {\n      util.showErrorToast('请输入详细地址');\n      return false;\n    }\n\n\n    let that = this;\n    util.request(api.AddressSave, { \n      id: address.id,\n      name: address.name,\n      mobile: address.mobile,\n      province_id: address.province_id,\n      city_id: address.city_id,\n      district_id: address.district_id,\n      address: address.address,\n      is_default: address.is_default,\n    }, 'POST').then(function (res) {\n      if (res.errno === 0) {\n        wx.reLaunch({\n          url: '/pages/shopping/address/address',\n        })\n      }\n    });\n\n  },\n  onShow: function () {\n    // 页面显示\n\n  },\n  onHide: function () {\n    // 页面隐藏\n\n  },\n  onUnload: function () {\n    // 页面关闭\n\n  }\n})"
  },
  {
    "path": "pages/shopping/addressAdd/addressAdd.json",
    "content": "{\n    \n}"
  },
  {
    "path": "pages/shopping/addressAdd/addressAdd.wxml",
    "content": "<view class=\"add-address\">\n    <view class=\"add-form\">\n        <view class=\"form-item\">\n            <input class=\"input\" bindinput=\"bindinputName\" placeholder=\"姓名\" value=\"{{address.name}}\" auto-focus/>\n        </view>\n        <view class=\"form-item\">\n            <input class=\"input\" bindinput=\"bindinputMobile\" value=\"{{address.mobile}}\" placeholder=\"手机号码\"/>\n        </view>\n        <view class=\"form-item\">\n            <input class=\"input\" value=\"{{address.full_region}}\" disabled=\"true\" bindtap=\"chooseRegion\" placeholder=\"省份、城市、区县\"/>\n        </view>\n        <view class=\"form-item\">\n            <input class=\"input\" bindinput=\"bindinputAddress\" value=\"{{address.address}}\" placeholder=\"详细地址, 如街道、楼盘号等\"/>\n        </view>\n        <view class=\"form-default\">\n            <text bindtap=\"bindIsDefault\" class=\"default-input {{address.is_default == 1 ? 'selected' : ''}}\">设为默认地址</text>\n        </view>\n    </view>\n\n    <view class=\"btns\">\n        <button class=\"cannel\" bindtap=\"cancelAddress\">取消</button>\n        <button class=\"save\" bindtap=\"saveAddress\">保存</button>\n    </view>\n\n    <view class=\"region-select\" wx:if=\"{{openSelectRegion}}\">\n      <view class=\"hd\">\n        <view class=\"region-selected\">\n          <view class=\"item {{item.id == 0 ? 'disabled' : ''}} {{(regionType -1) === index ? 'selected' : ''}}\" bindtap=\"selectRegionType\" data-region-type-index=\"{{index}}\" wx:for=\"{{selectRegionList}}\" wx:key=\"{{item.id}}\">{{item.name}}</view>\n        </view>\n        <view class=\"done {{selectRegionDone ? '' : 'disabled'}}\" bindtap=\"doneSelectRegion\">确定</view>\n      </view>\n      <view class=\"bd\">\n        <view class=\"region-list\">\n          <view class=\"item {{item.selected ? 'selected' : ''}}\" bindtap=\"selectRegion\" data-region-index=\"{{index}}\" wx:for=\"{{regionList}}\" wx:key=\"{{item.id}}\">{{item.name}}</view>\n        </view>\n      </view>\n    </view>\n</view>\n<view class=\"bg-mask\" bindtap=\"cancelSelectRegion\" wx:if=\"{{openSelectRegion}}\"></view>"
  },
  {
    "path": "pages/shopping/addressAdd/addressAdd.wxss",
    "content": "page{\n    height: 100%;\n    background: #f4f4f4;\n}\n.add-address .add-form{\n    background: #fff;\n    width: 100%;\n    height: auto;\n    overflow: hidden;\n}\n\n.add-address .form-item{\n    height: 116rpx;\n    padding-left: 31.25rpx;\n    border-bottom: 1px solid #d9d9d9;\n    display: flex;\n    align-items: center;\n    padding-right: 31.25rpx;\n}\n\n.add-address .input{\n    flex: 1;\n    height: 44rpx;\n    line-height: 44rpx;\n    overflow: hidden;\n}\n\n.add-address .form-default{\n    border-bottom: 1px solid #d9d9d9;\n    height: 96rpx;\n    background: #fafafa;\n    padding-top: 28rpx;\n    font-size: 28rpx;\n}\n\n.default-input{\n    margin: 0 auto;\n    display: block;\n    width: 240rpx;\n    height: 40rpx;\n    padding-left: 50rpx;\n    line-height: 40rpx;\n    background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/checkbox-sed825af9d3-a6b8540d42.png) 1rpx -448rpx no-repeat;\n    background-size: 38rpx 486rpx;\n    font-size: 28rpx;\n}\n\n.default-input.selected{\n    background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/checkbox-sed825af9d3-a6b8540d42.png) 0 -192rpx no-repeat;\n    background-size: 38rpx 486rpx;\n}\n\n.add-address .btns{\n    position: fixed;\n    bottom: 0;\n    left: 0;\n    overflow: hidden;\n    display: flex;\n    height: 100rpx;\n    width: 100%;\n}\n\n.add-address .cannel,.add-address .save{\n    flex: 1;\n    height: 100rpx;\n    text-align: center;\n    line-height: 100rpx;\n    font-size: 28rpx;\n    color: #fff;\n    border:none;\n    border-radius: 0;\n}\n\n.add-address .cannel{\n    background: #333;\n}\n\n.add-address .save{\n    background: #b4282d;\n}\n\n\n.region-select{\n  width: 100%;\n  height: 600rpx;\n  background: #fff;\n  position: fixed;\n  z-index: 10;\n  left:0;\n  bottom: 0;\n}\n\n.region-select .hd{\n  height: 108rpx;\n  width: 100%;\n  border-bottom: 1px solid #f4f4f4;\n  padding: 46rpx 30rpx 0 30rpx;\n}\n\n.region-select .region-selected{\n  float: left;\n  height: 60rpx;\n  display: flex;\n}\n\n.region-select .region-selected .item{\n  max-width: 140rpx;\n  margin-right: 30rpx;\n  text-align: left;\n  line-height: 60rpx;\n  height: 100%;\n  color: #333;\n  font-size: 28rpx;\n  overflow: hidden;\n      text-overflow: ellipsis;\n    white-space: nowrap;\n}\n\n.region-select .region-selected .item.disabled{\n  color: #999;\n}\n\n.region-select .region-selected .item.selected{\n  color: #b4282d;\n}\n\n.region-select .done{\n  float: right;\n  height: 60rpx;\n  width: 60rpx;\n  border: none;\n  background: #fff;\n  line-height: 60rpx;\n  text-align: center;\n  color: #333;\n  font-size: 28rpx;\n}\n\n.region-select .done.disabled{\n  color: #999;\n}\n\n\n\n.region-select .bd{\n  height: 492rpx;\n  width: 100%;\n  padding: 0 30rpx;\n}\n\n.region-select .region-list{\n  height: auto;\n  overflow: scroll;\n\n}\n\n.region-select .region-list .item{\n  width: 100%;\n  height: 104rpx;\n  line-height: 104rpx;\n  text-align: left;\n  color: #333;\n  font-size: 28rpx;\n}\n\n.region-select .region-list .item.selected{\n  color: #b4282d;\n}\n\n\n.bg-mask{\n  height: 100%;\n  width: 100%;\n  background: rgba(0, 0, 0, 0.4);\n  position: fixed;\n  top:0;\n  left:0;\n  z-index: 8;\n}\n"
  },
  {
    "path": "pages/shopping/checkout/checkout.js",
    "content": "var util = require('../../../utils/util.js');\nvar api = require('../../../config/api.js');\nconst pay = require('../../../services/pay.js');\n\nvar app = getApp();\n\nPage({\n  data: {\n    checkedGoodsList: [],\n    checkedAddress: {},\n    checkedCoupon: [],\n    couponList: [],\n    goodsTotalPrice: 0.00, //商品总价\n    freightPrice: 0.00,    //快递费\n    couponPrice: 0.00,     //优惠券的价格\n    orderTotalPrice: 0.00,  //订单总价\n    actualPrice: 0.00,     //实际需要支付的总价\n    addressId: 0,\n    couponId: 0\n  },\n  onLoad: function (options) {\n\n    // 页面初始化 options为页面跳转所带来的参数\n\n    try {\n      var addressId = wx.getStorageSync('addressId');\n      if (addressId) {\n        this.setData({\n          'addressId': addressId\n        });\n      }\n\n      var couponId = wx.getStorageSync('couponId');\n      if (couponId) {\n        this.setData({\n          'couponId': couponId\n        });\n      }\n    } catch (e) {\n      // Do something when catch error\n    }\n\n\n  },\n  getCheckoutInfo: function () {\n    let that = this;\n    util.request(api.CartCheckout, { addressId: that.data.addressId, couponId: that.data.couponId }).then(function (res) {\n      if (res.errno === 0) {\n        console.log(res.data);\n        that.setData({\n          checkedGoodsList: res.data.checkedGoodsList,\n          checkedAddress: res.data.checkedAddress,\n          actualPrice: res.data.actualPrice,\n          checkedCoupon: res.data.checkedCoupon,\n          couponList: res.data.couponList,\n          couponPrice: res.data.couponPrice,\n          freightPrice: res.data.freightPrice,\n          goodsTotalPrice: res.data.goodsTotalPrice,\n          orderTotalPrice: res.data.orderTotalPrice\n        });\n      }\n      wx.hideLoading();\n    });\n  },\n  selectAddress() {\n    wx.navigateTo({\n      url: '/pages/shopping/address/address',\n    })\n  },\n  addAddress() {\n    wx.navigateTo({\n      url: '/pages/shopping/addressAdd/addressAdd',\n    })\n  },\n  onReady: function () {\n    // 页面渲染完成\n\n  },\n  onShow: function () {\n    // 页面显示\n    wx.showLoading({\n      title: '加载中...',\n    })\n    this.getCheckoutInfo();\n\n  },\n  onHide: function () {\n    // 页面隐藏\n\n  },\n  onUnload: function () {\n    // 页面关闭\n\n  },\n  submitOrder: function () {\n    if (this.data.addressId <= 0) {\n      util.showErrorToast('请选择收货地址');\n      return false;\n    }\n    util.request(api.OrderSubmit, { addressId: this.data.addressId, couponId: this.data.couponId }, 'POST').then(res => {\n      if (res.errno === 0) {\n        const orderId = res.data.orderInfo.id;\n        pay.payOrder(parseInt(orderId)).then(res => {\n          wx.redirectTo({\n            url: '/pages/payResult/payResult?status=1&orderId=' + orderId\n          });\n        }).catch(res => {\n          wx.redirectTo({\n            url: '/pages/payResult/payResult?status=0&orderId=' + orderId\n          });\n        });\n      } else {\n        util.showErrorToast('下单失败');\n      }\n    });\n  }\n})"
  },
  {
    "path": "pages/shopping/checkout/checkout.json",
    "content": "{\n    \n}"
  },
  {
    "path": "pages/shopping/checkout/checkout.wxml",
    "content": "<view class=\"container\">\n    <view class=\"address-box\">\n        <view class=\"address-item\" bindtap=\"selectAddress\" wx:if=\"{{checkedAddress.id > 0}}\">\n            <view class=\"l\">\n                <text class=\"name\">{{checkedAddress.name}}</text>\n                <text class=\"default\" wx:if=\"{{checkedAddress.is_default === 1}}\">默认</text>\n            </view>\n            <view class=\"m\">\n                <text class=\"mobile\">{{checkedAddress.mobile}}</text>\n                <text class=\"address\">{{checkedAddress.full_region + checkedAddress.address}}</text>\n            </view>\n            <view class=\"r\">\n                <image src=\"/static/images/address_right.png\"></image>\n            </view>\n        </view>\n        <view class=\"address-item address-empty\" bindtap=\"addAddress\" wx:if=\"{{checkedAddress.id <= 0}}\">\n            <view class=\"m\">\n               还没有收货地址，去添加\n            </view>\n            <view class=\"r\">\n                <image src=\"/static/images/address_right.png\"></image>\n            </view>\n        </view>\n    </view>\n\n    <view class=\"coupon-box\">\n        <view class=\"coupon-item\">\n            <view class=\"l\">\n                <text class=\"name\">请选择优惠券</text>\n                <text class=\"txt\">{{couponList.length}}张</text>\n            </view>\n            <view class=\"r\">\n                <image src=\"/static/images/address_right.png\"></image>\n            </view>\n        </view>\n    </view>\n\n    <view class=\"order-box\">\n        <view class=\"order-item\">\n            <view class=\"l\">\n                <text class=\"name\">商品合计</text>\n            </view>\n            <view class=\"r\">\n                <text class=\"txt\">￥{{goodsTotalPrice}}</text>\n            </view>\n        </view>\n        <view class=\"order-item\">\n            <view class=\"l\">\n                <text class=\"name\">运费</text>\n            </view>\n            <view class=\"r\">\n                <text class=\"txt\">￥{{freightPrice}}</text>\n            </view>\n        </view>\n        <view class=\"order-item no-border\">\n            <view class=\"l\">\n                <text class=\"name\">优惠券</text>\n            </view>\n            <view class=\"r\">\n                <text class=\"txt\">-￥{{couponPrice}}</text>\n            </view>\n        </view>\n    </view>\n\n    <view class=\"goods-items\">\n        <view class=\"item\" wx:for=\"{{checkedGoodsList}}\" wx:key=\"{{item.id}}\">\n            <view class=\"img\">\n                <image src=\"{{item.list_pic_url}}\"></image>\n            </view>\n            <view class=\"info\">\n                <view class=\"t\">\n                    <text class=\"name\">{{item.goods_name}}</text>\n                    <text class=\"number\">x{{item.number}}</text>\n                </view>\n                <view class=\"m\">{{item.goods_specifition_name_value}}</view>\n                <view class=\"b\">￥{{item.retail_price}}</view>\n            </view>\n        </view>\n    </view>\n\n    <view class=\"order-total\">\n        <view class=\"l\">实付：￥{{actualPrice}}</view>\n        <view class=\"r\" bindtap=\"submitOrder\">去付款</view>\n    </view>\n</view>"
  },
  {
    "path": "pages/shopping/checkout/checkout.wxss",
    "content": "page{\n    height: 100%;\n    background: #f4f4f4;\n}\n\n.address-box{\n    width: 100%;\n    height: 166.55rpx;\n    background: url('http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/address-bg-bd30f2bfeb.png') 0 0 repeat-x;\n    background-size: 62.5rpx 10.5rpx;\n    margin-bottom: 20rpx;\n    padding-top: 10.5rpx;\n}\n\n.address-item{\n    display: flex;\n    height: 155.55rpx;\n    background: #fff;\n    padding: 41.6rpx 0 41.6rpx 31.25rpx;\n}\n\n.address-item.address-empty{\n  line-height: 75rpx;\n  text-align: center;\n}\n\n.address-box .l{\n    width: 125rpx;\n    height: 100%;\n}\n\n.address-box .l .name{\n    margin-left: 6.25rpx;\n    margin-top: -7.25rpx;\n    display: block;\n    width: 125rpx;\n    height: 43rpx;\n    line-height: 43rpx;\n    font-size: 30rpx;\n    color: #333;\n    margin-bottom: 5rpx;\n\n}\n\n.address-box .l .default{\n    margin-left: 6.25rpx;\n    display: block;\n    width: 62rpx;\n    height: 33rpx;\n    border-radius: 5rpx;\n    border: 1px solid #b4282d;\n    font-size: 20.5rpx;\n    text-align: center;\n    line-height: 29rpx;\n    color: #b4282d;\n}\n\n.address-box .m{\n    flex: 1;\n    height: 72.25rpx;\n    color: #999;\n}\n\n.address-box .mobile{\n    display: block;\n    height: 29rpx;\n    line-height: 29rpx;\n    margin-bottom: 6.25rpx;\n    font-size: 30rpx;\n    color:#333;\n}\n\n.address-box .address{\n    display: block;\n    height: 37.5rpx;\n    line-height: 37.5rpx;\n    font-size: 25rpx;\n    color:#666;\n}\n\n.address-box .r{\n    width: 77rpx;\n    height: 77rpx;\n    display: flex;\n    justify-content: center;\n    align-items: center;\n}\n\n.address-box .r image{\n    width: 52.078rpx;\n    height: 52.078rpx;\n}\n\n.coupon-box{\n    width: 100%;\n    height: auto;\n    overflow: hidden;\n    background: #fff;\n}\n\n.coupon-box .coupon-item{\n    width: 100%;\n    height: 108.3rpx;\n    overflow: hidden;\n    background: #fff;\n    display: flex;\n    padding-left: 31.25rpx;\n}\n\n.coupon-box .l{\n    flex: 1;\n    height: 43rpx;\n    line-height: 43rpx;\n    padding-top: 35rpx;\n}\n\n.coupon-box .l .name{\n    float: left;\n    font-size: 30rpx;\n    color: #666;\n}\n\n.coupon-box .l .txt{\n    float: right;\n    font-size: 30rpx;\n    color: #666;\n}\n\n.coupon-box .r{\n    margin-top: 15.5rpx;\n    width: 77rpx;\n    height: 77rpx;\n    display: flex;\n    justify-content: center;\n    align-items: center;\n}\n\n.coupon-box .r image{\n    width: 52.078rpx;\n    height: 52.078rpx;\n}\n\n.order-box{\n    margin-top: 20rpx;\n    width: 100%;\n    height: auto;\n    overflow: hidden;\n    background: #fff;\n}\n\n.order-box .order-item{\n    height: 104.3rpx;\n    overflow: hidden;\n    background: #fff;\n    display: flex;\n    margin-left: 31.25rpx;\n    padding-right: 31.25rpx;\n    padding-top: 26rpx;\n    border-bottom: 1px solid #d9d9d9;\n}\n\n.order-box .order-item .l{\n    float: left;\n    height: 52rpx;\n    width: 50%;\n    line-height: 52rpx;\n    overflow: hidden;\n}\n\n.order-box .order-item .r{\n    float: right;\n    text-align: right;\n    width: 50%;\n    height: 52rpx;\n    line-height: 52rpx;\n    overflow: hidden;\n}\n\n.order-box .order-item.no-border{\n    border-bottom: none;\n}\n\n.goods-items{\n    margin-top: 20rpx;\n    width: 100%;\n    height: auto;\n    overflow: hidden;\n    background: #fff;\n    padding-left: 31.25rpx;\n    margin-bottom: 120rpx;\n}\n\n.goods-items .item{\n    height: 192rpx;\n    padding-right: 31.25rpx;\n    display: flex;\n    align-items: center;\n    border-bottom: 1px solid rgba(0,0,0,0.15);\n}\n\n.goods-items .item.no-border{\n    border-bottom: none;\n}\n\n\n.goods-items .item:last-child{\n    border-bottom: none;\n}\n\n.goods-items .img{\n    height: 145.83rpx;\n    width: 145.83rpx;\n    background-color: #f4f4f4;\n    margin-right: 20rpx;\n}\n\n.goods-items .img image{\n    height: 145.83rpx;\n    width: 145.83rpx;\n}\n\n.goods-items .info{\n    flex: 1;\n    height: 145.83rpx;\n    padding-top: 5rpx;\n}\n\n.goods-items .t{\n    height:  33rpx;\n    line-height: 33rpx;\n    margin-bottom: 10rpx;\n    overflow: hidden;\n    font-size: 30rpx;\n    color: #333;\n}\n\n.goods-items .t .name{\n    display: block;\n    float: left;\n}\n\n.goods-items .t .number{\n    display: block;\n    float: right;\n    text-align: right;\n}\n\n.goods-items .m {\n    height:  29rpx;\n    overflow: hidden;\n    line-height: 29rpx;\n    margin-bottom: 25rpx;\n    font-size: 25rpx;\n    color: #666;\n}\n\n.goods-items .b {\n    height:  41rpx;\n    overflow: hidden;\n    line-height: 41rpx;\n    font-size: 30rpx;\n    color: #333;\n}\n\n.order-total{\n    position: fixed;\n    left:0;\n    bottom: 0;\n    height: 100rpx;\n    width: 100%;\n    display: flex;\n}\n\n.order-total .l{\n    flex: 1;\n    height: 100rpx;\n    line-height: 100rpx;\n    color: #b4282d;\n    background: #fff;\n    font-size: 33rpx;\n    padding-left: 31.25rpx;\n    border-top: 1rpx solid rgba(0,0,0,0.2);\n    border-bottom: 1rpx solid rgba(0,0,0,0.2);\n}\n\n.order-total .r{\n    width: 233rpx;\n    height: 100rpx;\n    background: #b4282d;\n    border: 1px solid #b4282d;\n    line-height: 100rpx;\n    text-align: center;\n    color: #fff;\n    font-size: 30rpx;\n}"
  },
  {
    "path": "pages/topic/topic.js",
    "content": "var util = require('../../utils/util.js');\nvar api = require('../../config/api.js');\nvar app = getApp()\nPage({\n    data: {\n        // text:\"这是一个页面\"\n        topicList: [],\n        page: 1,\n        size: 10,\n        count: 0,\n        scrollTop: 0,\n        showPage: false\n    },\n    onLoad: function (options) {\n        // 页面初始化 options为页面跳转所带来的参数\n        this.getTopic();\n\n    },\n    onReady: function () {\n        // 页面渲染完成\n    },\n    onShow: function () {\n        // 页面显示\n    },\n    onHide: function () {\n        // 页面隐藏\n    },\n    onUnload: function () {\n        // 页面关闭\n    },\n    nextPage: function (event) {\n      console.log();\n        var that = this;\n        if (this.data.page+1 > that.data.count / that.data.size) {\n            return true;\n        }\n\n        \n        that.setData({\n            \"page\": parseInt(that.data.page) + 1\n        });\n\n        this.getTopic();\n        \n    },\n    getTopic: function(){\n       \n        let that = this;\n         that.setData({\n            scrollTop: 0,\n            showPage: false,\n            topicList: []\n        });\n        // 页面渲染完成\n        wx.showToast({\n            title: '加载中...',\n            icon: 'loading',\n            duration: 2000\n        });\n\n        util.request(api.TopicList, { page: that.data.page, size: that.data.size }).then(function (res) {\n          if (res.errno === 0) {\n\n            that.setData({\n              scrollTop: 0,\n              topicList: res.data.data,\n              showPage: true,\n              count: res.data.count\n            });\n          }\n          wx.hideToast();\n        });\n        \n    },\n    prevPage: function (event) {\n        if (this.data.page <= 1) {\n            return false;\n        }\n\n        var that = this;\n        that.setData({\n            \"page\": parseInt(that.data.page) - 1\n        });\n        this.getTopic();\n    }\n})"
  },
  {
    "path": "pages/topic/topic.json",
    "content": "{}"
  },
  {
    "path": "pages/topic/topic.wxml",
    "content": "<view class=\"container\">\n    <scroll-view class=\"topic-list\" scroll-y=\"true\" scroll-top=\"{{scrollTop}}\">\n        <navigator class=\"item\" wx:for=\"{{topicList}}\" wx:key=\"{{item.id}}\" url=\"../topicDetail/topicDetail?id={{item.id}}\">\n            <image class=\"img\" src=\"{{item.scene_pic_url}}\"></image>\n            <view class=\"info\">\n                <text class=\"title\">{{item.title}}</text>\n                <text class=\"desc\">{{item.subtitle}}</text>\n                <text class=\"price\">{{item.price_info}}元起</text>\n            </view>\n        </navigator>\n        <view class=\"page\" wx:if=\"{{showPage}}\">\n            <view class=\"prev {{ page <= 1 ? 'disabled' : ''}}\" bindtap=\"prevPage\">上一页</view>\n            <view class=\"next {{ (count / size) < page +1 ? 'disabled' : ''}}\" bindtap=\"nextPage\">下一页</view>\n        </view>\n    </scroll-view>\n</view>"
  },
  {
    "path": "pages/topic/topic.wxss",
    "content": "page ,.container{\n   width: 750rpx;\n    height: 100%;\n    overflow: hidden;\n    background: #f4f4f4;\n}\n.topic-list{\n    width: 750rpx;\n    height: 100%;\n    overflow: hidden;\n    background: #f4f4f4;\n}\n\n.topic-list .item{\n    width: 100%;\n    height: 625rpx;\n    overflow: hidden;\n    background: #fff;\n    margin-bottom: 20rpx;\n}\n\n.topic-list .img{\n    width: 100%;\n    height: 415rpx;\n}\n\n.topic-list .info{\n    width: 100%;\n    height: 210rpx;\n    overflow: hidden;\n}\n\n.topic-list .title{\n    display: block;\n    text-align: center;\n    width: 100%;\n    height: 33rpx;\n    line-height: 35rpx;\n    color: #333;\n    overflow: hidden;\n    font-size: 35rpx;\n    margin-top: 30rpx;\n}\n\n.topic-list .desc{\n    display: block;\n    text-align: center;\n    position: relative;\n    width: auto;\n    height: 24rpx;\n    line-height: 24rpx;\n    overflow: hidden;\n    color: #999;\n    font-size: 24rpx;\n    margin-top: 16rpx;\n    margin-bottom: 30rpx;\n}\n\n.topic-list .price{\n    display: block;\n    text-align: center;\n    width: 100%;\n    height: 27rpx;\n    line-height: 27rpx;\n    overflow: hidden;\n    color: #b4282d;\n    font-size: 27rpx;\n}\n\n\n.page{\n    width: 750rpx;\n    height: 108rpx;\n    background: #fff;\n    margin-bottom: 20rpx;\n}\n\n.page view{\n    height: 108rpx;\n    width: 50%;\n    float: left;\n    font-size: 29rpx;\n    color: #333;\n    text-align: center;\n    line-height: 108rpx;\n}\n\n.page .prev{\n    border-right: 1px solid #D9D9D9;\n}\n\n.page .disabled{\n    color: #ccc;\n}"
  },
  {
    "path": "pages/topicComment/topicComment.js",
    "content": "var app = getApp();\nvar util = require('../../utils/util.js');\n\nvar api = require('../../config/api.js');\n\nPage({\n  data: {\n    comments: [],\n    allCommentList: [],\n    picCommentList: [],\n    typeId: 0,\n    valueId: 0,\n    showType: 0,\n    allCount: 0,\n    hasPicCount: 0,\n    allPage: 1,\n    picPage: 1,\n    size: 20\n  },\n  getCommentCount: function () {\n    let that = this;\n    util.request(api.CommentCount, { valueId: that.data.valueId, typeId: that.data.typeId}).then(function (res) {\n      if (res.errno === 0) {\n\n        that.setData({\n          allCount: res.data.allCount,\n          hasPicCount: res.data.hasPicCount\n        });\n      }\n    });\n  },\n  getCommentList: function(){\n    let that = this;\n    util.request(api.CommentList, { \n      valueId: that.data.valueId, \n      typeId: that.data.typeId, \n      size: that.data.size,\n      page: (that.data.showType == 0 ? that.data.allPage : that.data.picPage),\n      showType: that.data.showType \n      }).then(function (res) {\n      if (res.errno === 0) {\n\n        if (that.data.showType == 0) {\n          that.setData({\n            allCommentList: that.data.allCommentList.concat(res.data.data),\n            allPage: res.data.currentPage,\n            comments: that.data.allCommentList.concat(res.data.data)\n          });\n        } else {\n          that.setData({\n            picCommentList: that.data.picCommentList.concat(res.data.data),\n            picPage: res.data.currentPage,\n            comments: that.data.picCommentList.concat(res.data.data)\n          });\n        }\n      }\n    });\n  },\n  onLoad: function (options) {\n    // 页面初始化 options为页面跳转所带来的参数\n    this.setData({\n      typeId: options.typeId,\n      valueId: options.valueId\n    });\n    this.getCommentCount();\n    this.getCommentList();\n  },\n  onReady: function () {\n    // 页面渲染完成\n\n  },\n  onShow: function () {\n    // 页面显示\n\n  },\n  onHide: function () {\n    // 页面隐藏\n\n  },\n  onUnload: function () {\n    // 页面关闭\n\n  },\n  switchTab: function () {\n    this.setData({\n      showType: this.data.showType == 1 ? 0 :1\n    });\n\n    this.getCommentList();\n  },\n  onReachBottom: function(){\n    console.log('onPullDownRefresh');\n    if ( this.data.showType == 0) {\n\n      if (this.data.allCount / this.data.size < this.data.allPage) {\n        return false;\n      }\n\n      this.setData({\n        'allPage' : this.data.allPage + 1\n      });\n    } else {\n      if (this.data.hasPicCount / this.data.size < this.data.picPage) {\n        return false;\n      }\n\n      this.setData({\n        'picPage': this.data.picPage + 1\n      });\n    }\n\n\n\n    this.getCommentList();\n  }\n})"
  },
  {
    "path": "pages/topicComment/topicComment.json",
    "content": "{\n\n}"
  },
  {
    "path": "pages/topicComment/topicComment.wxml",
    "content": "<view class=\"comments\">\n  <view class=\"b\">\n    <view class=\"item\" wx:for=\"{{comments}}\" wx:key=\"{{item.id}}\">\n      <view class=\"info\">\n        <view class=\"user\">\n          <image src=\"{{item.user_info.avatar}}\"></image>\n          <text>{{item.user_info.nickname}}</text>\n        </view>\n        <view class=\"time\">{{item.add_time}}</view>\n      </view>\n      <view class=\"comment\">{{item.content}}</view>\n      <view class=\"imgs\" wx:if=\"{{item.pic_list.length > 0}}\">\n        <image class=\"img\" wx:for=\"{{item.pic_list}}\" wx:key=\"{{pitem.id}}\" wx:for-item=\"pitem\" src=\"{{pitem.pic_url}}\"></image>\n      </view>\n      <!--<view class=\"customer-service\" wx:if=\"{{item.commentReplyVO}}\">\n        <text class=\"u\">小选回复：</text>\n        <text class=\"c\">{{item.commentReplyVO.replyContent}}</text>\n      </view>-->\n    </view>\n\n  </view>\n</view>"
  },
  {
    "path": "pages/topicComment/topicComment.wxss",
    "content": ".comments{\n    width: 100%;\n    height: auto;\n    padding-left:30rpx;\n    background: #fff;\n    margin: 20rpx 0;\n}\n\n.comments .b{\n    height: auto;\n    width: 720rpx;\n}\n\n.comments .b.no-h{\n    margin-top: 0;\n}\n\n.comments .item{\n    height: auto;\n    width: 720rpx;\n    overflow: hidden;\n    border-bottom: 1px solid #d9d9d9;\n    padding-bottom: 25rpx;\n}\n\n.comments .info{\n    height: 127rpx;\n    width: 100%;\n    padding: 33rpx 0 27rpx 0;\n}\n\n.comments .user{\n    float: left;\n    width: auto;\n    height: 67rpx;\n    line-height: 67rpx;\n    font-size: 0;\n}\n\n.comments .user image{\n    float: left;\n    width: 67rpx;\n    height: 67rpx;\n    margin-right: 17rpx;\n    border-radius: 50%;\n}\n\n.comments .user text{\n    display: inline-block;\n    width: auto;\n    height: 66rpx;\n    overflow: hidden;\n    font-size: 29rpx;\n    line-height: 66rpx;\n}\n\n.comments .time{\n    display: block;\n    float: right;\n    width: auto;\n    height: 67rpx;\n    line-height: 67rpx;\n    color: #7f7f7f;\n    font-size: 25rpx;\n    margin-right: 30rpx;\n}\n\n.comments .comment{\n    width: 720rpx;\n    padding-right: 30rpx;\n    line-height: 45.8rpx;\n    font-size: 29rpx;\n    margin-bottom: 16rpx;\n}\n\n.comments .imgs{\n    width: 720rpx;\n    height: 150rpx;\n    margin-bottom: 25rpx;\n}\n\n.comments .imgs .img{\n    height: 150rpx;\n    width: 150rpx;\n    margin-right: 28rpx;\n}\n\n.comments .customer-service{\n    width: 690rpx;\n    height: auto;\n    overflow: hidden;\n    margin-top: 23rpx;\n    background: rgba(0,0,0,.03);\n    padding: 21rpx;\n}\n\n\n.comments .customer-service .u{\n    font-size: 24rpx;\n    color: #333;\n    line-height: 37.5rpx;\n}\n\n.comments .customer-service .c{\n    font-size: 24rpx;\n    color: #999;\n    line-height: 37.5rpx;\n}"
  },
  {
    "path": "pages/topicDetail/topicDetail.js",
    "content": "var app = getApp();\nvar WxParse = require('../../lib/wxParse/wxParse.js');\nvar util = require('../../utils/util.js');\nvar api = require('../../config/api.js');\n\nPage({\n  data: {\n    id: 0,\n    topic: {},\n    topicList: [],\n    commentCount: 0,\n    commentList: []\n  },\n  onLoad: function (options) {\n    // 页面初始化 options为页面跳转所带来的参数\n    var that = this;\n    that.setData({\n      id: parseInt(options.id)\n    });\n\n    util.request(api.TopicDetail, { id: that.data.id}).then(function (res) {\n      if (res.errno === 0) {\n\n        that.setData({\n          topic: res.data,\n        });\n\n        WxParse.wxParse('topicDetail', 'html', res.data.content, that);\n      }\n    });\n\n    util.request(api.TopicRelated, { id: that.data.id}).then(function (res) {\n      if (res.errno === 0) {\n\n        that.setData({\n          topicList: res.data\n        });\n      }\n    });\n  },\n  getCommentList(){\n    let that = this;\n    util.request(api.CommentList, { valueId: that.data.id, typeId: 1, size: 5 }).then(function (res) {\n      if (res.errno === 0) {\n\n        that.setData({\n          commentList: res.data.data,\n          commentCount: res.data.count\n        });\n      }\n    });\n  },\n  postComment (){\n    wx.navigateTo({\n      url: '/pages/commentPost/commentPost?valueId='+this.data.id + '&typeId=1',\n    })\n  },\n  onReady: function () {\n\n  },\n  onShow: function () {\n    // 页面显示\n    this.getCommentList();\n  },\n  onHide: function () {\n    // 页面隐藏\n\n  },\n  onUnload: function () {\n    // 页面关闭\n\n  }\n})"
  },
  {
    "path": "pages/topicDetail/topicDetail.json",
    "content": "{}"
  },
  {
    "path": "pages/topicDetail/topicDetail.wxml",
    "content": "<scroll-view class=\"container\">\n  <scroll-view class=\"content\">\n    <import src=\"../../lib/wxParse/wxParse.wxml\"/> \n    <template is=\"wxParse\" data=\"{{wxParseData:topicDetail.nodes}}\"/>\n  </scroll-view>\n  <view class=\"topic-goods\">\n  </view>\n  <scroll-view class=\"comments\">\n    <view class=\"h\">\n      <text class=\"t\">精选留言</text>\n      <image bindtap=\"postComment\" class=\"i\" src=\"http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/comment-add-2aca147c3f.png\"></image>\n    </view>\n     <view class=\"has-comments\" wx:if=\"{{commentList.length > 0 }}\">\n      <view class=\"b\">\n        <view class=\"item\" wx:for=\"{{commentList}}\" wx:key=\"{{item.id}}\">\n          <view class=\"info\">\n            <view class=\"user\">\n              <image class=\"avatar\" src=\"{{item.user_info.avatar}}\"></image>\n              <text class=\"nickname\">{{item.user_info.nickname}}</text>\n            </view>\n            <view class=\"time\">{{item.add_time}}</view>\n          </view>\n          <view class=\"comment\">\n            {{item.content}}\n          </view>\n        </view>\n      </view>\n      <view class=\"load\" wx:if=\"{{commentCount > 5}}\">\n        <navigator url=\"/pages/topicComment/topicComment?valueId={{topic.id}}&typeId=1\">查看更多</navigator>\n      </view>\n    </view> \n    <view class=\"no-comments\" wx:if=\"{{commentList.length <= 0}}\">\n        <view class=\"b\">    \n            <image class=\"icon\" src=\"http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/no-comment-560f87660a.png\"></image>\n            <text class=\"txt\">等你来留言</text>\n        </view>\n    </view>\n  </scroll-view>\n  <scroll-view class=\"rec-box\">\n    <view class=\"h\">\n      <text class=\"txt\">专题推荐</text>\n    </view>\n    <view class=\"b\">\n      <navigator class=\"item\" wx:for=\"{{topicList}}\" url=\"../topicDetail/topicDetail?id={{item.id}}\">\n        <image class=\"img\" src=\"{{item.scene_pic_url}}\"></image>\n        <text class=\"title\">{{item.title}}</text>\n      </navigator>\n    </view>\n  </scroll-view>\n</scroll-view>"
  },
  {
    "path": "pages/topicDetail/topicDetail.wxss",
    "content": "\n\n\n.content{\n    width: 100%;\n    height: auto;\n    font-size: 0;\n}\n\n.content image{\n    display: inline-block;\n    width: 100%;\n}\n\n.comments{\n    width: 100%;\n    height: auto;\n    padding-left:30rpx;\n    background: #fff;\n    margin-top: 20rpx;\n}\n\n.comments .h{\n    height: 93rpx;\n    line-height: 93rpx;\n    width: 720rpx;\n    padding-right: 30rpx;\n    border-bottom: 1px solid #d9d9d9;\n}\n\n.comments .h .t{\n    display: block;\n    float: left;\n    width: 50%;\n    font-size: 29rpx;\n    color: #333;\n}\n\n.comments .h .i{\n    display: block;\n    float: right;\n    margin-top: 30rpx;\n    width: 33rpx;\n    height: 33rpx;\n}\n\n.comments .b{\n    height: auto;\n    width: 720rpx;\n}\n\n.comments .item{\n    height: auto;\n    width: 720rpx;\n    overflow: hidden;\n    border-bottom: 1px solid #d9d9d9;\n}\n\n.comments .info{\n    height: 127rpx;\n    width: 100%;\n    padding: 33rpx 0 27rpx 0;\n}\n\n.comments .user{\n    float: left;\n    width: auto;\n    height: 67rpx;\n    line-height: 67rpx;\n    font-size: 0;\n}\n\n.comments .user .avatar{\n    display: block;\n    float: left;\n    width: 67rpx;\n    height: 67rpx;\n    margin-right: 17rpx;\n    border-radius: 50%;\n}\n\n.comments .user .nickname{\n    display: block;\n    width: auto;\n    float: left;\n    height: 66rpx;\n    overflow: hidden;\n    font-size: 29rpx;\n    line-height: 66rpx;\n}\n\n.comments .time{\n    display: block;\n    float: right;\n    width: auto;\n    height: 67rpx;\n    line-height: 67rpx;\n    color: #7f7f7f;\n    font-size: 25rpx;\n    margin-right: 30rpx;\n}\n\n.comments .comment{\n    width: 720rpx;\n    padding-right: 30rpx;\n    line-height: 45.8rpx;\n    margin-bottom: 30rpx;\n    font-size: 29rpx;\n    color: #333;\n}\n\n.comments .load{\n    width: 720rpx;\n    height: 108rpx;\n    line-height: 108rpx;\n    text-align: center;\n    font-size: 38.5rpx;\n}\n\n.no-comments{\n    height: 297rpx;\n}\n\n.no-comments .txt{\n    height: 43rpx;\n    line-height: 43rpx;\n    display: block;\n    width: 100%;\n    text-align: center;\n    font-size: 29rpx;\n    color: #7f7f7f;\n}\n\n.no-comments .icon{\n    margin: 48rpx auto 18rpx auto;\n    height: 130rpx;\n    display: block;\n    width: 115rpx;\n}\n\n\n.rec-box{\n    width: 690rpx;\n    height: auto;\n    margin: 0 30rpx;\n}\n\n.rec-box .h{\n    position: relative;\n    width: 690rpx;\n    height: 96rpx;\n    /*border-bottom: 1px solid #d0d0d0;*/\n    margin-bottom: 32rpx;\n}\n\n.rec-box .h .txt{\n    display: inline-block;\n    position: absolute;\n    background: #f4f4f4;\n    top: 59rpx;\n    left: 200rpx;\n    width: 290rpx;\n    height: 45rpx;\n    line-height: 45rpx;\n    font-size: 30rpx;\n    color: #999;\n    text-align: center;\n}\n\n.rec-box .b .item{\n    width: 690rpx;\n    height: 397rpx;\n    padding: 24rpx 24rpx 30rpx 24rpx;\n    background: #fff;\n    margin-bottom: 30rpx;\n}\n\n.rec-box .b .item .img{\n    height: 278rpx;\n    width: 642rpx;\n}\n\n.rec-box .b .item .title{\n    display: block;\n    margin-top: 30rpx;\n    height: 30rpx;\n    width: 642rpx;\n    font-size: 28rpx;\n}\n@import \"../../lib/wxParse/wxParse.wxss\";\n"
  },
  {
    "path": "pages/ucenter/address/address.js",
    "content": "var util = require('../../../utils/util.js');\nvar api = require('../../../config/api.js');\nvar app = getApp();\n\nPage({\n  data: {\n    addressList: [],\n  },\n  onLoad: function (options) {\n    // 页面初始化 options为页面跳转所带来的参数\n    this.getAddressList();\n  },\n  onReady: function () {\n    // 页面渲染完成\n  },\n  onShow: function () {\n    // 页面显示\n\n  },\n  getAddressList (){\n    let that = this;\n    util.request(api.AddressList).then(function (res) {\n      if (res.errno === 0) {\n        that.setData({\n          addressList: res.data\n        });\n      }\n    });\n  },\n  addressAddOrUpdate (event) {\n    console.log(event)\n    wx.navigateTo({\n      url: '/pages/ucenter/addressAdd/addressAdd?id=' + event.currentTarget.dataset.addressId\n    })\n  },\n  deleteAddress(event){\n    console.log(event.target)\n    let that = this;\n    wx.showModal({\n      title: '',\n      content: '确定要删除地址？',\n      success: function (res) {\n        if (res.confirm) {\n          let addressId = event.target.dataset.addressId;\n          util.request(api.AddressDelete, { id: addressId }, 'POST').then(function (res) {\n            if (res.errno === 0) {\n              that.getAddressList();\n            }\n          });\n          console.log('用户点击确定')\n        }\n      }\n    })\n    return false;\n    \n  },\n  onHide: function () {\n    // 页面隐藏\n  },\n  onUnload: function () {\n    // 页面关闭\n  }\n})"
  },
  {
    "path": "pages/ucenter/address/address.json",
    "content": "{}"
  },
  {
    "path": "pages/ucenter/address/address.wxml",
    "content": "<view class=\"container\">\n    <view class=\"address-list\" wx:if=\"{{ addressList.length > 0 }}\">\n        <view class=\"item\" wx:for=\"{{addressList}}\" wx:key=\"{{item.id}}\" bindtap=\"addressAddOrUpdate\" data-address-id=\"{{item.id}}\">\n            <view class=\"l\">\n                <view class=\"name\">{{item.name}}</view>\n                <view class=\"default\" wx:if=\"{{item.is_default}}\">默认</view>\n            </view>\n            <view class=\"c\">\n                <view class=\"mobile\">{{item.mobile}}</view>\n                <view class=\"address\">{{item.full_region + item.address}}</view>\n            </view>\n            <view class=\"r\">\n                <image catchtap=\"deleteAddress\" data-address-id=\"{{item.id}}\" class=\"del\" src=\"/static/images/del-address.png\"></image>\n            </view>\n        </view>\n    </view>\n    <view class=\"empty-view\" wx:if=\"{{ addressList.length <= 0 }}\">\n      <image class=\"icon\" src=\"http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/noAddress-26d570cefa.png\"></image>\n      <text class=\"text\">收货地址在哪里</text>\n    </view>\n    <view class=\"add-address\" bindtap=\"addressAddOrUpdate\" data-address-id=\"0\">新建</view>\n</view>\n"
  },
  {
    "path": "pages/ucenter/address/address.wxss",
    "content": "page{\n    height: 100%;\n    width: 100%;\n    background: #f4f4f4;\n}\n\n.container{\n  height: 100%;\n  width: 100%;\n}\n\n.address-list{\n    padding-left: 31.25rpx;\n    background: #fff url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/address-bg-bd30f2bfeb.png) 0 0 repeat-x;\n    background-size: auto 10.5rpx;\n    margin-bottom: 90rpx;\n}\n\n.address-list .item{\n    height: 156.55rpx;\n    align-items: center;\n    display: flex;\n    border-bottom: 1rpx solid #DCD9D9;\n}\n\n.address-list .l{\n    width: 125rpx;\n    height: 80rpx;\n    overflow: hidden;\n}\n\n.address-list .name{\n    width: 125rpx;\n    height: 43rpx;\n    font-size: 29rpx;\n    color: #333;\n    margin-bottom: 5.2rpx;\n        text-overflow: ellipsis;\n    white-space: nowrap;\n    overflow: hidden;\n}\n\n.address-list .default{\n    width: 62.5rpx;\n    height: 33rpx;\n    line-height: 28rpx;\n    text-align: center;\n    font-size: 20rpx;\n    color: #b4282d;\n    border: 1rpx solid #b4282d;\n    visibility: visible;\n}\n\n\n.address-list .c{\n    flex: 1;\n    height: auto;\n    overflow: hidden;\n}\n\n.address-list .mobile{\n\n    height: 29rpx;\n    font-size: 29rpx;\n    line-height: 29rpx;\n    overflow: hidden;\n    color: #333;\n    margin-bottom: 6.25rpx;\n}\n\n.address-list .address{\n    height: 37rpx;\n    font-size: 25rpx;\n    line-height: 37rpx;\n    overflow: hidden;\n    color: #666;\n}\n\n.address-list .r{\n    width: 52rpx;\n    height: auto;\n    overflow: hidden;\n    margin-right: 16.5rpx;\n}\n\n.address-list .del{\n    display: block;\n    width: 52rpx;\n    height: 52rpx;\n}\n\n.add-address{\n    background: #b4282d;\n    text-align: center;\n    width: 100%;\n    height: 99rpx;\n    line-height: 99rpx;\n    position: fixed;\n    border-radius: 0;\n    border: none;\n    color: #fff;\n    font-size: 29rpx;\n    bottom: 0;\n    left:0;\n}\n\n.empty-view{\n  height: 100%;\n  width: 100%;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n}\n\n.empty-view .icon{\n  height: 248rpx;\n  width: 258rpx;\n  margin-bottom: 10rpx;\n}\n\n.empty-view .text{\n  width: auto;\n  font-size: 28rpx;\n  line-height: 35rpx;\n  color: #999;\n}"
  },
  {
    "path": "pages/ucenter/addressAdd/addressAdd.js",
    "content": "var util = require('../../../utils/util.js');\nvar api = require('../../../config/api.js');\nvar app = getApp();\nPage({\n  data: {\n    address: {\n      id:0,\n      province_id: 0,\n      city_id: 0,\n      district_id: 0,\n      address: '',\n      full_region: '',\n      name: '',\n      mobile: '',\n      is_default: 0\n    },\n    addressId: 0,\n    openSelectRegion: false,\n    selectRegionList: [\n      { id: 0, name: '省份', parent_id: 1, type: 1 },\n      { id: 0, name: '城市', parent_id: 1, type: 2 },\n      { id: 0, name: '区县', parent_id: 1, type: 3 }\n    ],\n    regionType: 1,\n    regionList: [],\n    selectRegionDone: false\n  },\n  bindinputMobile(event) {\n    let address = this.data.address;\n    address.mobile = event.detail.value;\n    this.setData({\n      address: address\n    });\n  },\n  bindinputName(event) {\n    let address = this.data.address;\n    address.name = event.detail.value;\n    this.setData({\n      address: address\n    });\n  },\n  bindinputAddress (event){\n    let address = this.data.address;\n    address.address = event.detail.value;\n    this.setData({\n      address: address\n    });\n  },\n  bindIsDefault(){\n    let address = this.data.address;\n    address.is_default = !address.is_default;\n    this.setData({\n      address: address\n    });\n  },\n  getAddressDetail() {\n    let that = this;\n    util.request(api.AddressDetail, { id: that.data.addressId }).then(function (res) {\n      if (res.errno === 0) {\n        that.setData({\n          address: res.data\n        });\n      }\n    });\n  },\n  setRegionDoneStatus() {\n    let that = this;\n    let doneStatus = that.data.selectRegionList.every(item => {\n      return item.id != 0;\n    });\n\n    that.setData({\n      selectRegionDone: doneStatus\n    })\n\n  },\n  chooseRegion() {\n    let that = this;\n    this.setData({\n      openSelectRegion: !this.data.openSelectRegion\n    });\n\n    //设置区域选择数据\n    let address = this.data.address;\n    if (address.province_id > 0 && address.city_id > 0 && address.district_id > 0) {\n      let selectRegionList = this.data.selectRegionList;\n      selectRegionList[0].id = address.province_id;\n      selectRegionList[0].name = address.province_name;\n      selectRegionList[0].parent_id = 1;\n\n      selectRegionList[1].id = address.city_id;\n      selectRegionList[1].name = address.city_name;\n      selectRegionList[1].parent_id = address.province_id;\n\n      selectRegionList[2].id = address.district_id;\n      selectRegionList[2].name = address.district_name;\n      selectRegionList[2].parent_id = address.city_id;\n\n      this.setData({\n        selectRegionList: selectRegionList,\n        regionType: 3\n      });\n\n      this.getRegionList(address.city_id);\n    } else {\n      this.setData({\n        selectRegionList: [\n          { id: 0, name: '省份', parent_id: 1, type: 1 },\n          { id: 0, name: '城市', parent_id: 1, type: 2 },\n          { id: 0, name: '区县', parent_id: 1, type: 3 }\n        ],\n        regionType: 1\n      })\n      this.getRegionList(1);\n    }\n\n    this.setRegionDoneStatus();\n\n  },\n  onLoad: function (options) {\n    // 页面初始化 options为页面跳转所带来的参数\n    console.log(options)\n    if (options.id) {\n      this.setData({\n        addressId: options.id\n      });\n      this.getAddressDetail();\n    }\n\n    this.getRegionList(1);\n\n  },\n  onReady: function () {\n\n  },\n  selectRegionType(event) {\n    let that = this;\n    let regionTypeIndex = event.target.dataset.regionTypeIndex;\n    let selectRegionList = that.data.selectRegionList;\n\n    //判断是否可点击\n    if (regionTypeIndex + 1 == this.data.regionType || (regionTypeIndex - 1 >= 0 && selectRegionList[regionTypeIndex-1].id <= 0)) {\n      return false;\n    }\n\n    this.setData({\n      regionType: regionTypeIndex + 1\n    })\n    \n    let selectRegionItem = selectRegionList[regionTypeIndex];\n\n    this.getRegionList(selectRegionItem.parent_id);\n\n    this.setRegionDoneStatus();\n\n  },\n  selectRegion(event) {\n    let that = this;\n    let regionIndex = event.target.dataset.regionIndex;\n    let regionItem = this.data.regionList[regionIndex];\n    let regionType = regionItem.type;\n    let selectRegionList = this.data.selectRegionList;\n    selectRegionList[regionType - 1] = regionItem;\n\n\n    if (regionType != 3) {\n      this.setData({\n        selectRegionList: selectRegionList,\n        regionType: regionType + 1\n      })\n      this.getRegionList(regionItem.id);\n    } else {\n      this.setData({\n        selectRegionList: selectRegionList\n      })\n    }\n\n    //重置下级区域为空\n    selectRegionList.map((item, index) => {\n      if (index > regionType - 1) {\n        item.id = 0;\n        item.name = index == 1 ? '城市' : '区县';\n        item.parent_id = 0;\n      }\n      return item;\n    });\n\n    this.setData({\n      selectRegionList: selectRegionList\n    })\n\n\n    that.setData({\n      regionList: that.data.regionList.map(item => {\n\n        //标记已选择的\n        if (that.data.regionType == item.type && that.data.selectRegionList[that.data.regionType - 1].id == item.id) {\n          item.selected = true;\n        } else {\n          item.selected = false;\n        }\n\n        return item;\n      })\n    });\n\n    this.setRegionDoneStatus();\n\n  },\n  doneSelectRegion() {\n    if (this.data.selectRegionDone === false) {\n      return false;\n    }\n\n    let address = this.data.address;\n    let selectRegionList = this.data.selectRegionList;\n    address.province_id = selectRegionList[0].id;\n    address.city_id = selectRegionList[1].id;\n    address.district_id = selectRegionList[2].id;\n    address.province_name = selectRegionList[0].name;\n    address.city_name = selectRegionList[1].name;\n    address.district_name = selectRegionList[2].name;\n    address.full_region = selectRegionList.map(item => {\n      return item.name;\n    }).join('');\n\n    this.setData({\n      address: address,\n      openSelectRegion: false\n    });\n\n  },\n  cancelSelectRegion() {\n    this.setData({\n      openSelectRegion: false,\n      regionType: this.data.regionDoneStatus ? 3 : 1\n    });\n\n  },\n  getRegionList(regionId) {\n    let that = this;\n    let regionType = that.data.regionType;\n    util.request(api.RegionList, { parentId: regionId }).then(function (res) {\n      if (res.errno === 0) {\n        that.setData({\n          regionList: res.data.map(item => {\n\n            //标记已选择的\n            if (regionType == item.type && that.data.selectRegionList[regionType - 1].id == item.id) {\n              item.selected = true;\n            } else {\n              item.selected = false;\n            }\n\n            return item;\n          })\n        });\n      }\n    });\n  },\n  cancelAddress(){\n    wx.navigateTo({\n      url: '/pages/ucenter/address/address',\n    })\n  },\n  saveAddress(){\n    console.log(this.data.address)\n    let address = this.data.address;\n\n    if (address.name == '') {\n      util.showErrorToast('请输入姓名');\n\n      return false;\n    }\n\n    if (address.mobile == '') {\n      util.showErrorToast('请输入手机号码');\n      return false;\n    }\n\n\n    if (address.district_id == 0) {\n      util.showErrorToast('请输入省市区');\n      return false;\n    }\n\n    if (address.address == '') {\n      util.showErrorToast('请输入详细地址');\n      return false;\n    }\n\n\n    let that = this;\n    util.request(api.AddressSave, { \n      id: address.id,\n      name: address.name,\n      mobile: address.mobile,\n      province_id: address.province_id,\n      city_id: address.city_id,\n      district_id: address.district_id,\n      address: address.address,\n      is_default: address.is_default,\n    }, 'POST').then(function (res) {\n      if (res.errno === 0) {\n        wx.navigateTo({\n          url: '/pages/ucenter/address/address',\n        })\n      }\n    });\n\n  },\n  onShow: function () {\n    // 页面显示\n\n  },\n  onHide: function () {\n    // 页面隐藏\n\n  },\n  onUnload: function () {\n    // 页面关闭\n\n  }\n})"
  },
  {
    "path": "pages/ucenter/addressAdd/addressAdd.json",
    "content": "{\n    \n}"
  },
  {
    "path": "pages/ucenter/addressAdd/addressAdd.wxml",
    "content": "<view class=\"add-address\">\n    <view class=\"add-form\">\n        <view class=\"form-item\">\n            <input class=\"input\" bindinput=\"bindinputName\" placeholder=\"姓名\" value=\"{{address.name}}\" auto-focus/>\n        </view>\n        <view class=\"form-item\">\n            <input class=\"input\" bindinput=\"bindinputMobile\" value=\"{{address.mobile}}\" placeholder=\"手机号码\"/>\n        </view>\n        <view class=\"form-item\">\n            <input class=\"input\" value=\"{{address.full_region}}\" disabled=\"true\" bindtap=\"chooseRegion\" placeholder=\"省份、城市、区县\"/>\n        </view>\n        <view class=\"form-item\">\n            <input class=\"input\" bindinput=\"bindinputAddress\" value=\"{{address.address}}\" placeholder=\"详细地址, 如街道、楼盘号等\"/>\n        </view>\n        <view class=\"form-default\">\n            <text bindtap=\"bindIsDefault\" class=\"default-input {{address.is_default == 1 ? 'selected' : ''}}\">设为默认地址</text>\n        </view>\n    </view>\n\n    <view class=\"btns\">\n        <button class=\"cannel\" bindtap=\"cancelAddress\">取消</button>\n        <button class=\"save\" bindtap=\"saveAddress\">保存</button>\n    </view>\n\n    <view class=\"region-select\" wx:if=\"{{openSelectRegion}}\">\n      <view class=\"hd\">\n        <view class=\"region-selected\">\n          <view class=\"item {{item.id == 0 ? 'disabled' : ''}} {{(regionType -1) === index ? 'selected' : ''}}\" bindtap=\"selectRegionType\" data-region-type-index=\"{{index}}\" wx:for=\"{{selectRegionList}}\" wx:key=\"{{item.id}}\">{{item.name}}</view>\n        </view>\n        <view class=\"done {{selectRegionDone ? '' : 'disabled'}}\" bindtap=\"doneSelectRegion\">确定</view>\n      </view>\n      <view class=\"bd\">\n        <view class=\"region-list\">\n          <view class=\"item {{item.selected ? 'selected' : ''}}\" bindtap=\"selectRegion\" data-region-index=\"{{index}}\" wx:for=\"{{regionList}}\" wx:key=\"{{item.id}}\">{{item.name}}</view>\n        </view>\n      </view>\n    </view>\n</view>\n<view class=\"bg-mask\" bindtap=\"cancelSelectRegion\" wx:if=\"{{openSelectRegion}}\"></view>"
  },
  {
    "path": "pages/ucenter/addressAdd/addressAdd.wxss",
    "content": "page{\n    height: 100%;\n    background: #f4f4f4;\n}\n.add-address .add-form{\n    background: #fff;\n    width: 100%;\n    height: auto;\n    overflow: hidden;\n}\n\n.add-address .form-item{\n    height: 116rpx;\n    padding-left: 31.25rpx;\n    border-bottom: 1px solid #d9d9d9;\n    display: flex;\n    align-items: center;\n    padding-right: 31.25rpx;\n}\n\n.add-address .input{\n    flex: 1;\n    height: 44rpx;\n    line-height: 44rpx;\n    overflow: hidden;\n}\n\n.add-address .form-default{\n    border-bottom: 1px solid #d9d9d9;\n    height: 96rpx;\n    background: #fafafa;\n    padding-top: 28rpx;\n    font-size: 28rpx;\n}\n\n.default-input{\n    margin: 0 auto;\n    display: block;\n    width: 240rpx;\n    height: 40rpx;\n    padding-left: 50rpx;\n    line-height: 40rpx;\n    background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/checkbox-sed825af9d3-a6b8540d42.png) 1rpx -448rpx no-repeat;\n    background-size: 38rpx 486rpx;\n    font-size: 28rpx;\n}\n\n.default-input.selected{\n    background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/checkbox-sed825af9d3-a6b8540d42.png) 0 -192rpx no-repeat;\n    background-size: 38rpx 486rpx;\n}\n\n.add-address .btns{\n    position: fixed;\n    bottom: 0;\n    left: 0;\n    overflow: hidden;\n    display: flex;\n    height: 100rpx;\n    width: 100%;\n}\n\n.add-address .cannel,.add-address .save{\n    flex: 1;\n    height: 100rpx;\n    text-align: center;\n    line-height: 100rpx;\n    font-size: 28rpx;\n    color: #fff;\n    border:none;\n    border-radius: 0;\n}\n\n.add-address .cannel{\n    background: #333;\n}\n\n.add-address .save{\n    background: #b4282d;\n}\n\n\n.region-select{\n  width: 100%;\n  height: 600rpx;\n  background: #fff;\n  position: fixed;\n  z-index: 10;\n  left:0;\n  bottom: 0;\n}\n\n.region-select .hd{\n  height: 108rpx;\n  width: 100%;\n  border-bottom: 1px solid #f4f4f4;\n  padding: 46rpx 30rpx 0 30rpx;\n}\n\n.region-select .region-selected{\n  float: left;\n  height: 60rpx;\n  display: flex;\n}\n\n.region-select .region-selected .item{\n  max-width: 140rpx;\n  margin-right: 30rpx;\n  text-align: left;\n  line-height: 60rpx;\n  height: 100%;\n  color: #333;\n  font-size: 28rpx;\n  overflow: hidden;\n      text-overflow: ellipsis;\n    white-space: nowrap;\n}\n\n.region-select .region-selected .item.disabled{\n  color: #999;\n}\n\n.region-select .region-selected .item.selected{\n  color: #b4282d;\n}\n\n.region-select .done{\n  float: right;\n  height: 60rpx;\n  width: 60rpx;\n  border: none;\n  background: #fff;\n  line-height: 60rpx;\n  text-align: center;\n  color: #333;\n  font-size: 28rpx;\n}\n\n.region-select .done.disabled{\n  color: #999;\n}\n\n\n\n.region-select .bd{\n  height: 492rpx;\n  width: 100%;\n  padding: 0 30rpx;\n}\n\n.region-select .region-list{\n  height: auto;\n  overflow: scroll;\n\n}\n\n.region-select .region-list .item{\n  width: 100%;\n  height: 104rpx;\n  line-height: 104rpx;\n  text-align: left;\n  color: #333;\n  font-size: 28rpx;\n}\n\n.region-select .region-list .item.selected{\n  color: #b4282d;\n}\n\n\n.bg-mask{\n  height: 100%;\n  width: 100%;\n  background: rgba(0, 0, 0, 0.4);\n  position: fixed;\n  top:0;\n  left:0;\n  z-index: 8;\n}\n"
  },
  {
    "path": "pages/ucenter/collect/collect.js",
    "content": "var util = require('../../../utils/util.js');\nvar api = require('../../../config/api.js');\n\nvar app = getApp();\n\nPage({\n  data: {\n    typeId: 0,\n    collectList: []\n  },\n  getCollectList() {\n    let that = this;\n    util.request(api.CollectList, { typeId: that.data.typeId}).then(function (res) {\n      if (res.errno === 0) {\n        console.log(res.data);\n        that.setData({\n          collectList: res.data.data\n        });\n      }\n    });\n  },\n  onLoad: function (options) {\n    this.getCollectList();\n  },\n  onReady: function () {\n\n  },\n  onShow: function () {\n\n  },\n  onHide: function () {\n    // 页面隐藏\n\n  },\n  onUnload: function () {\n    // 页面关闭\n  },\n  openGoods(event) {\n    \n    let that = this;\n    let goodsId = this.data.collectList[event.currentTarget.dataset.index].value_id;\n\n    //触摸时间距离页面打开的毫秒数  \n    var touchTime = that.data.touch_end - that.data.touch_start;\n    console.log(touchTime);\n    //如果按下时间大于350为长按  \n    if (touchTime > 350) {\n      wx.showModal({\n        title: '',\n        content: '确定删除吗？',\n        success: function (res) {\n          if (res.confirm) {\n            \n            util.request(api.CollectAddOrDelete, { typeId: that.data.typeId, valueId: goodsId}, 'POST').then(function (res) {\n              if (res.errno === 0) {\n                console.log(res.data);\n                wx.showToast({\n                  title: '删除成功',\n                  icon: 'success',\n                  duration: 2000\n                });\n                that.getCollectList();\n              }\n            });\n          }\n        }\n      })\n    } else {\n      \n      wx.navigateTo({\n        url: '/pages/goods/goods?id=' + goodsId,\n      });\n    }  \n  },\n  //按下事件开始  \n  touchStart: function (e) {\n    let that = this;\n    that.setData({\n      touch_start: e.timeStamp\n    })\n    console.log(e.timeStamp + '- touch-start')\n  },\n  //按下事件结束  \n  touchEnd: function (e) {\n    let that = this;\n    that.setData({\n      touch_end: e.timeStamp\n    })\n    console.log(e.timeStamp + '- touch-end')\n  }, \n})"
  },
  {
    "path": "pages/ucenter/collect/collect.json",
    "content": "{\n  \n}"
  },
  {
    "path": "pages/ucenter/collect/collect.wxml",
    "content": "<view class=\"container\">\n  <view class=\"collect-list\">\n    <view class=\"item\" bindtap=\"openGoods\"  bindtouchstart=\"touchStart\" bindtouchend=\"touchEnd\" wx:for=\"{{collectList}}\" wx:key=\"{{item.id}}\" data-index=\"{{index}}\">\n      <image class=\"img\" src=\"{{item.list_pic_url}}\"></image>\n      <view class=\"info\">\n        <view class=\"name\">{{item.name}}</view>\n        <view class=\"subtitle\">{{item.goods_brief}}</view>\n        <view class=\"price\">￥{{item.retail_price}}</view>\n      </view>\n    </view>\n  </view>\n</view>"
  },
  {
    "path": "pages/ucenter/collect/collect.wxss",
    "content": "page{\n    background: #f4f4f4;\n    min-height: 100%;\n}\n\n.container{\n    background: #f4f4f4;\n    min-height: 100%;\n}\n\n.collect-list{\n  width: 100%;\n  height: auto;\n  overflow: hidden;\n  background: #fff;\n  padding-left: 30rpx;\n  border-top: 1px solid #e1e1e1;\n}\n\n.item{\n  height: 212rpx;\n  width: 720rpx;\n  background: #fff;\n  padding: 30rpx 30rpx 30rpx 0;\n  border-bottom: 1px solid #e1e1e1;\n}\n\n.item:last-child{\n  border-bottom: 1px solid #fff;\n}\n\n.item .img{\n  float: left;\n  width: 150rpx;\n  height: 150rpx;\n}\n\n.item .info{\n  float: right;\n  width: 540rpx;\n  height: 150rpx;\n  display: flex;\n  flex-direction: column;\n  justify-content: center;\n  padding-left: 20rpx;\n}\n\n.item .info .name{\n  font-size: 28rpx;\n  color: #333;\n  line-height: 40rpx;\n}\n\n\n.item .info .subtitle{\n  margin-top: 8rpx;\n  font-size: 24rpx;\n  color: #888;\n  line-height: 40rpx;\n}\n\n.item .info .price{\n  margin-top: 8rpx;\n  font-size: 28rpx;\n  color: #333;\n  line-height: 40rpx;\n}\n"
  },
  {
    "path": "pages/ucenter/coupon/coupon.js",
    "content": "var util = require('../../../utils/util.js');\nvar api = require('../../../config/api.js');\n\n\n\nvar app = getApp();\n\nPage({\n  data: {\n\n  },\n  onLoad: function (options) {\n  },\n  onReady: function () {\n\n  },\n  onShow: function () {\n\n  },\n  onHide: function () {\n    // 页面隐藏\n\n  },\n  onUnload: function () {\n    // 页面关闭\n  }\n})"
  },
  {
    "path": "pages/ucenter/coupon/coupon.json",
    "content": "{\n  \n}"
  },
  {
    "path": "pages/ucenter/coupon/coupon.wxml",
    "content": "<view class=\"container\">\n  <view class=\"coupon-form\">\n    <view class=\"input-box\">\n      <input class=\"coupon-sn\" placeholder=\"请输入优惠码\" />\n      <image class=\"clear-icon\" src=\"http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/clear-fb-dd9d604f86.png\"></image>\n    </view>\n    <button class=\"add-btn disabled\">兑换</button>\n  </view>\n  <view class=\"help\">使用说明</view>\n  <view class=\"coupon-list\">\n    <view class=\"item\">\n      <view class=\"tag\">新人专享</view>\n      <view class=\"content\">\n        <view class=\"left\">\n          <view class=\"name\">限时免单券</view>\n          <view class=\"time\">2017.06.08-2017.06.11</view>\n        </view>\n        <view class=\"right\">\n          <button class=\"go\">去使用</button>\n        </view>\n      </view>\n      <view class=\"condition\">\n        <text class=\"txt\">简约陶瓷马克杯专享；小米用户福利；限时购、三石福利价、礼品卡及详情页标注不可用券特殊商品除外</text>\n        <image src=\"https://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/couponArrow-71315b4145.png\" class=\"icon\"></image>\n      </view>\n    </view>\n\n     <view class=\"item\">\n      <view class=\"tag\">新人专享</view>\n      <view class=\"content\">\n        <view class=\"left\">\n          <view class=\"name\">限时免单券</view>\n          <view class=\"time\">2017.06.08-2017.06.11</view>\n        </view>\n        <view class=\"right\">\n          <button class=\"go\">去使用</button>\n        </view>\n      </view>\n      <view class=\"condition\">\n        <text class=\"txt\">简约陶瓷马克杯专享；小米用户福利；限时购、三石福利价、礼品卡及详情页标注不可用券特殊商品除外</text>\n        <image src=\"https://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/couponArrow-71315b4145.png\" class=\"icon\"></image>\n      </view>\n    </view>\n  </view>\n\n\n</view>"
  },
  {
    "path": "pages/ucenter/coupon/coupon.wxss",
    "content": "page{\n    background: #f4f4f4;\n    min-height: 100%;\n}\n\n.container{\n    background: #f4f4f4;\n    min-height: 100%;\n    padding-top: 30rpx;\n}\n\n.coupon-form{\n  height: 110rpx;\n  width: 100%;\n  background: #fff;\n  padding-left: 30rpx;\n  padding-right: 30rpx;\n  padding-top: 20rpx;\n  display: flex;\n}\n\n.input-box{\n  flex: 1;\n  height: 70rpx;\n  color: #333;\n  font-size: 24rpx;\n  background: #fff;\n  position: relative;\n  border: 1px solid rgba(0, 0, 0, 0.15);\n  border-radius: 4rpx;\n  margin-right: 30rpx;\n}\n\n.input-box .coupon-sn{\n  position: absolute;\n  top: 10rpx;\n  left: 30rpx;\n  height: 50rpx;\n  width: 100%;\n  color: #000;\n  line-height: 50rpx;\n  font-size: 24rpx;\n}\n\n.clear-icon{\n  position: absolute;\n  top: 21rpx;\n  right: 30rpx;\n  width: 28rpx;\n  height: 28rpx;\n}\n\n.add-btn{\n  height: 70rpx;\n  border:none;\n  width: 168rpx;\n  background: #b4282d;\n  border-radius: 0;\n  line-height: 70rpx;\n  color: #fff;\n  font-size: 28rpx;\n}\n\n.add-btn.disabled{\n  background: #ccc;\n}\n\n.help{\n  height: 72rpx;\n  line-height: 72rpx;\n  text-align: right;\n  padding-right: 30rpx;\n  background: url(https://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/couponHelp-4768607555.png) 590rpx center no-repeat;\n  background-size: 28rpx;\n  color: #999;\n  font-size: 24rpx;\n}\n\n.coupon-list{\n  width: 100%;\n  height: auto;\n  overflow: hidden;\n  padding-left: 30rpx;\n  padding-right: 30rpx;\n}\n\n.item{\n  position: relative;\n  height: 290rpx;\n  width: 100%;\n  background: linear-gradient(to right,#cfa568,#e3bf79);\n  margin-bottom: 30rpx;\n  padding-top: 52rpx;\n}\n\n.tag{\n  height: 32rpx;\n  background: #A48143;\n  padding-left: 16rpx;\n  padding-right: 16rpx;\n  position: absolute;\n  left: 20rpx;\n  color: #fff;\n  top: 20rpx;\n  font-size: 20rpx;\n  text-align: center;\n  line-height: 32rpx;\n}\n\n\n.content{\n  margin-top: 24rpx;\n  margin-left: 40rpx;\n  display: flex;\n  margin-right: 40rpx;\n  flex-direction: row;\n  align-items: center;\n}\n\n.content .left{\n  flex: 1;\n}\n\n.name{\n  font-size: 44rpx;\n  color: #fff;\n  margin-bottom: 14rpx;\n}\n\n.time{\n  font-size: 24rpx;\n  color: rgba(255,255,255, 0.8);\n  line-height: 30rpx;\n}\n\n.content .right{\n  width: 162rpx;\n}\n\n.go{\n  height: 48rpx;\n  border:none;\n  width: 162rpx;\n  background: rgba(255,255,255, 0.8);\n  border-radius: 4rpx;\n  line-height: 48rpx;\n  color: #b69150;\n  font-size: 24rpx;\n}\n\n.condition{\n  position: absolute;\n  width: 100%;\n  bottom: 0;\n  left:0;\n  height: 78rpx;\n  background: rgba(0,0,0,.08);\n  padding: 24rpx 40rpx;\n  display: flex;\n  flex-direction: row;\n}\n\n.condition .txt{\n  display: block;\n  height: 30rpx;\n  flex: 1;\n  overflow: hidden;\n  font-size: 24rpx;\n  line-height: 30rpx;\n  color: #fff;\n}\n\n\n.condition .icon{\n  margin-left: 30rpx;\n  width: 24rpx;\n  height: 24rpx;\n}"
  },
  {
    "path": "pages/ucenter/express/express.js",
    "content": "var util = require('../../../utils/util.js');\nvar api = require('../../../config/api.js');\nvar app = getApp();\n\nPage({\n  data: {\n    orderId: 1,\n    expressInfo: {},\n    expressTraces: []\n  },\n  onLoad: function (options) {\n    this.setData({\n      orderId: options.id\n    });\n    this.getExpressInfo();\n  },\n  onReady: function () {\n    // 页面渲染完成\n  },\n  onShow: function () {\n    // 页面显示\n\n  },\n  getExpressInfo() {\n    let that = this;\n    util.request(api.OrderExpress, { orderId: that.data.orderId }).then(function (res) {\n      if (res.errno === 0) {\n        that.setData({\n          expressInfo: res.data,\n          expressTraces: res.data.traces\n        });\n      }\n    });\n  },\n  updateExpress() {\n    this.getExpressInfo();\n  },\n  onHide: function () {\n    // 页面隐藏\n  },\n  onUnload: function () {\n    // 页面关闭\n  }\n})"
  },
  {
    "path": "pages/ucenter/express/express.json",
    "content": "{\n  \"navigationBarTitleText\": \"物流详情\"\n}"
  },
  {
    "path": "pages/ucenter/express/express.wxml",
    "content": "<view class=\"container\">\n  <view class='express-header'>\n    <view class=\"left\">\n      <view class=\"txt\">物流单号：{{expressInfo.logistic_code}}</view>\n      <view class=\"txt\">物流公司：{{expressInfo.shipper_name}}</view>\n      <view class=\"txt\">更新时间：{{expressInfo.request_time}}</view>\n    </view>\n    <view class='right' wx:if=\"{{expressInfo.isFinish === 1}}\">\n      <view class='update-btn' bindtap=\"updateExpress\">更新物流</view>\n    </view>\n  </view>\n  <view class='express-body'>\n    <view class='current-icon'></view>\n    <view class=\"express-item item-{{index}}\" wx:for=\"{{expressTraces}}\" wx:key=\"{{key}}\">\n      <view class='left'></view>\n      <view class='right'>\n        <view class=\"info\">{{item.content}}</view>\n        <view class=\"time\">{{item.datetime}}</view>\n      </view>\n    </view>\n  </view>\n</view>"
  },
  {
    "path": "pages/ucenter/express/express.wxss",
    "content": "page {\n  height: 100%;\n  width: 100%;\n  background: #f4f4f4;\n}\n\n.container {\n  height: 100%;\n  width: 100%;\n}\n\n.express-header {\n  border-top: 1px solid #d9d9d9;\n  width: 100%;\n  height: auto;\n  overflow: hidden;\n  background: #fff;\n  display: flex;\n  padding: 20rpx 30rpx;\n}\n\n.express-header .left {\n  flex: 1;\n  height: 100%;\n}\n\n.express-header .left .txt {\n  height: 50rpx;\n  line-height: 50rpx;\n  overflow: hidden;\n  width: 100%;\n}\n\n.express-header .right {\n  width: 160rpx;\n  height: 100%;\n  display: flex;\n}\n\n.express-header .update-btn {\n  margin-top: 47rpx;\n  width: 158rpx;\n  height: 56rpx;\n  line-height: 54rpx;\n  overflow: hidden;\n  text-align: center;\n  border-radius: 8rpx;\n  color: #333;\n  border: 1px solid #666;\n}\n\n.express-body {\n  margin-top: 20rpx;\n  width: 100%;\n  height: auto;\n  overflow: hidden;\n  background: #fff;\n  padding: 30rpx;\n  position: relative;\n}\n\n.current-icon{\n  height: 24rpx;\n  width: 24rpx;\n  position: absolute;\n  top: 30rpx;\n  left: 50rpx;\n  background: #b4282d;\n  border-radius: 24rpx;\n}\n\n.express-item {\n  height: auto;\n  width: 100%;\n  overflow: hidden;\n  display: flex;\n  margin-left: 30rpx;\n  border-left: 1px solid #d9d9d9;\n}\n\n.express-item .left {\n  width: 44rpx;\n  height: 100%;\n  overflow: hidden;\n}\n\n.express-item .right {\n  flex: 1;\n  height: 100%;\n  margin-left: 10rpx;\n  padding: 20rpx 0;\n  border-bottom: 1px solid #f1f2f4;\n}\n\n.express-item.item-0 .right {\n  padding-top: 0rpx;\n}\n\n.express-item:last-child .right{\n  border-bottom: none;\n  padding-bottom: 0rpx;\n}\n\n.express-item .right .info {\n  min-height: 42rpx;\n  height: auto;\n  overflow: hidden;\n  padding-right: 30rpx;\n  line-height: 42rpx;\n  color: #999;\n}\n\n.express-item.item-0 .right .info {\n  color: #b4282d;\n}\n\n.express-item .right .time {\n  min-height: 42rpx;\n  height: auto;\n  overflow: hidden;\n  line-height: 42rpx;\n  color: #999;\n}\n\n.express-item.item-0 .right .time {\n  color: #b4282d;\n}\n"
  },
  {
    "path": "pages/ucenter/feedback/feedback.js",
    "content": "var util = require('../../../utils/util.js');\nvar api = require('../../../config/api.js');\n\n\n\nvar app = getApp();\n\nPage({\n  data: {\n    array: ['请选择反馈类型', '商品相关', '物流状况', '客户服务', '优惠活动', '功能异常', '产品建议', '其他'],\n    index: 0,\n  },\n  bindPickerChange: function (e) {\n    console.log('picker发送选择改变，携带值为', e.detail.value)\n    this.setData({\n      index: e.detail.value\n    })\n  },\n  onLoad: function (options) {\n  },\n  onReady: function () {\n\n  },\n  onShow: function () {\n\n  },\n  onHide: function () {\n    // 页面隐藏\n\n  },\n  onUnload: function () {\n    // 页面关闭\n  }\n})"
  },
  {
    "path": "pages/ucenter/feedback/feedback.json",
    "content": "{\n  \n}"
  },
  {
    "path": "pages/ucenter/feedback/feedback.wxml",
    "content": "<view class=\"container\">\n\n  <picker bindchange=\"bindPickerChange\" value=\"{{index}}\" range=\"{{array}}\">\n    <view class=\"picker\">\n      <view class=\"fb-type\">\n        <view class=\"type-label\">{{array[index]}}</view>\n        <image class=\"type-icon\" src=\"http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/pickerArrow-a8b918f05f.png\"></image>\n\n      </view>\n    </view>\n  </picker>\n  <view class=\"fb-body\">\n    <textarea class=\"content\" placeholder=\"对我们网站、商品、服务，你还有什么建议吗？你还希望在严选上买到什么？请告诉我们...\" />\n    <view class=\"text-count\">0/500</view>\n  </view>\n  <view class=\"fb-mobile\">\n    <view class=\"label\">手机号码</view>\n    <view class=\"mobile-box\">\n      <input class=\"mobile\" placeholder=\"方便我们与你联系\" />\n      <image class=\"clear-icon\" src=\"http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/clear-fb-dd9d604f86.png\"></image>\n    </view>\n  </view>\n\n  <button class=\"fb-btn\">提交</button>\n</view>"
  },
  {
    "path": "pages/ucenter/feedback/feedback.wxss",
    "content": "page{\n    background: #f4f4f4;\n    min-height: 100%;\n}\n\n.container{\n    background: #f4f4f4;\n    min-height: 100%;\n    padding-top: 30rpx;\n}\n\n.fb-type{\n  height: 104rpx;\n  width: 100%;\n  background: #fff;\n  margin-bottom: 20rpx;\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  padding-left: 30rpx;\n  padding-right: 30rpx;\n}\n\n.fb-type .type-label{\n  height: 36rpx;\n  flex: 1;\n  color: #333;\n  font-size: 28rpx;\n}\n\n.fb-type .type-icon{\n  height: 36rpx;\n  width: 36rpx;\n}\n\n.fb-body{\n  width: 100%;\n  background: #fff;\n  height: 374rpx;\n  padding: 18rpx 30rpx 64rpx 30rpx;\n}\n\n.fb-body .content{\n  width: 100%;\n  height: 100%;\n  color: #333;\n  line-height: 40rpx;\n  font-size: 28rpx;\n}\n\n.fb-body .text-count{\n  padding-top: 17rpx;\n  line-height: 30rpx;\n  float: right;\n  color: #666;\n  font-size: 24rpx;\n}\n\n.fb-mobile{\n  height: 162rpx;\n  width: 100%;\n}\n\n.fb-mobile .label{\n  height: 58rpx;\n  width: 100%;\n  padding-top: 14rpx;\n  padding-bottom: 11rpx;\n  color: #7f7f7f;\n  font-size: 24rpx;\n  padding-left: 30rpx;\n  padding-right: 30rpx;\n  line-height: 33rpx;\n}\n\n.fb-mobile .mobile-box{\n  height: 104rpx;\n  width: 100%;\n  color: #333;\n  padding-left: 30rpx;\n  padding-right: 30rpx;\n  font-size: 24rpx;\n  background: #fff;\n  position: relative;\n}\n\n.fb-mobile .mobile{\n  position: absolute;\n  top: 27rpx;\n  left: 30rpx;\n  height: 50rpx;\n  width: 100%;\n  color: #333;\n  line-height: 50rpx;\n  font-size: 24rpx;\n}\n\n.clear-icon{\n  position: absolute;\n  top: 43rpx;\n  right: 30rpx;\n  width: 28rpx;\n  height: 28rpx;\n}\n\n.fb-btn{\n  width: 100%;\n  height: 98rpx;\n  line-height: 98rpx;\n  background: #b4282d;\n  position: fixed;\n  bottom: 0;\n  left: 0;\n  border-radius: 0;\n  color: #fff;\n  font-size: 28rpx;\n}"
  },
  {
    "path": "pages/ucenter/footprint/footprint.js",
    "content": "var util = require('../../../utils/util.js');\nvar api = require('../../../config/api.js');\n\n\n\nvar app = getApp();\n\nPage({\n  data: {\n    footprintList: [],\n  },\n  getFootprintList() {\n    let that = this;\n    util.request(api.FootprintList).then(function (res) {\n      if (res.errno === 0) {\n        console.log(res.data);\n        that.setData({\n          footprintList: res.data.data\n        });\n      }\n    });\n  },\n  deleteItem (event){\n    let that = this;\n    let footprint = event.currentTarget.dataset.footprint;\n    var touchTime = that.data.touch_end - that.data.touch_start;\n    console.log(touchTime);\n    //如果按下时间大于350为长按  \n    if (touchTime > 350) {\n      wx.showModal({\n        title: '',\n        content: '要删除所选足迹？',\n        success: function (res) {\n          if (res.confirm) {\n            util.request(api.FootprintDelete, { footprintId: footprint.id }, 'POST').then(function (res) {\n              if (res.errno === 0) {\n                wx.showToast({\n                  title: '删除成功',\n                  icon: 'success',\n                  duration: 2000\n                });\n                that.getFootprintList();\n              }\n            });\n            console.log('用户点击确定')\n          }\n        }\n      });\n    } else {\n      wx.navigateTo({\n        url: '/pages/goods/goods?id=' + footprint.goods_id,\n      });\n    }\n    \n  },\n  onLoad: function (options) {\n    this.getFootprintList();\n  },\n  onReady: function () {\n\n  },\n  onShow: function () {\n\n  },\n  onHide: function () {\n    // 页面隐藏\n\n  },\n  onUnload: function () {\n    // 页面关闭\n  },\n  //按下事件开始  \n  touchStart: function (e) {\n    let that = this;\n    that.setData({\n      touch_start: e.timeStamp\n    })\n    console.log(e.timeStamp + '- touch-start')\n  },\n  //按下事件结束  \n  touchEnd: function (e) {\n    let that = this;\n    that.setData({\n      touch_end: e.timeStamp\n    })\n    console.log(e.timeStamp + '- touch-end')\n  }, \n})"
  },
  {
    "path": "pages/ucenter/footprint/footprint.json",
    "content": "{\n  \n}"
  },
  {
    "path": "pages/ucenter/footprint/footprint.wxml",
    "content": "<view class=\"container\">\n  <view class=\"footprint\">\n    <view class=\"day-item\" wx:for=\"{{footprintList}}\" wx:key=\"{{index}}\">\n      <view class=\"day-hd\">{{item[0].add_time}}</view>\n      <view class=\"day-list\">\n        <view class=\"item\" data-footprint=\"{{iitem}}\" bindtouchstart=\"touchStart\" bindtouchend=\"touchEnd\" bindtap=\"deleteItem\" wx:for=\"{{item}}\"  wx:for-item=\"iitem\" wx:key=\"{{iitem.id}}\">\n          <image class=\"img\" src=\"{{iitem.list_pic_url}}\"></image>\n          <view class=\"info\">\n            <view class=\"name\">{{iitem.name}}</view>\n            <view class=\"subtitle\">{{iitem.goods_brief}}</view>\n            <view class=\"price\">￥{{iitem.retail_price}}</view>\n          </view>\n        </view>\n      </view>\n    </view>\n  </view>\n</view>"
  },
  {
    "path": "pages/ucenter/footprint/footprint.wxss",
    "content": "page{\n    background: #f4f4f4;\n    min-height: 100%;\n}\n\n.container{\n    background: #f4f4f4;\n    min-height: 100%;\n}\n\n.footprint{\n   height: auto;\n  overflow: hidden;\n  width: 100%;\n  border-top: 1px solid #e1e1e1;\n}\n\n.day-item{\n  height: auto;\n  overflow: hidden;\n  width: 100%;\n  margin-bottom: 20rpx;\n}\n\n.day-hd{\n  height: 94rpx;\n  width: 100%;\n  line-height: 94rpx;\n  background: #fff;\n  padding-left: 30rpx;\n  color: #333;\n  font-size: 28rpx;\n}\n\n.day-list{\n  width: 100%;\n  height: auto;\n  overflow: hidden;\n  background: #fff;\n  padding-left: 30rpx;\n  border-top: 1px solid #e1e1e1;\n}\n\n.item{\n  height: 212rpx;\n  width: 720rpx;\n  background: #fff;\n  padding: 30rpx 30rpx 30rpx 0;\n  border-bottom: 1px solid #e1e1e1;\n}\n\n.item:last-child{\n  border-bottom: 1px solid #fff;\n}\n\n.item .img{\n  float: left;\n  width: 150rpx;\n  height: 150rpx;\n}\n\n.item .info{\n  float: right;\n  width: 540rpx;\n  height: 150rpx;\n  display: flex;\n  flex-direction: column;\n  justify-content: center;\n  padding-left: 20rpx;\n}\n\n.item .info .name{\n  font-size: 28rpx;\n  color: #333;\n  line-height: 40rpx;\n}\n\n\n.item .info .subtitle{\n  margin-top: 8rpx;\n  font-size: 24rpx;\n  color: #888;\n  line-height: 40rpx;\n}\n\n.item .info .price{\n  margin-top: 8rpx;\n  font-size: 28rpx;\n  color: #333;\n  line-height: 40rpx;\n}\n"
  },
  {
    "path": "pages/ucenter/index/index.js",
    "content": "const util = require('../../../utils/util.js');\nconst api = require('../../../config/api.js');\nconst user = require('../../../services/user.js');\nconst app = getApp();\n\nPage({\n  data: {\n    userInfo: {},\n    showLoginDialog: false\n  },\n  onLoad: function(options) {\n    // 页面初始化 options为页面跳转所带来的参数\n  },\n  onReady: function() {\n\n  },\n  onShow: function() {\n    this.setData({\n      userInfo: app.globalData.userInfo,\n    });\n  },\n  onHide: function() {\n    // 页面隐藏\n\n  },\n  onUnload: function() {\n    // 页面关闭\n  },\n\n  onUserInfoClick: function() {\n    if (wx.getStorageSync('token')) {\n\n    } else {\n      this.showLoginDialog();\n    }\n  },\n\n  showLoginDialog() {\n    this.setData({\n      showLoginDialog: true\n    })\n  },\n\n  onCloseLoginDialog () {\n    this.setData({\n      showLoginDialog: false\n    })\n  },\n\n  onDialogBody () {\n    // 阻止冒泡\n  },\n\n  onWechatLogin(e) {\n    if (e.detail.errMsg !== 'getUserInfo:ok') {\n      if (e.detail.errMsg === 'getUserInfo:fail auth deny') {\n        return false\n      }\n      wx.showToast({\n        title: '微信登录失败',\n      })\n      return false\n    }\n    util.login().then((res) => {\n      return util.request(api.AuthLoginByWeixin, {\n        code: res,\n        userInfo: e.detail\n      }, 'POST');\n    }).then((res) => {\n      console.log(res)\n      if (res.errno !== 0) {\n        wx.showToast({\n          title: '微信登录失败',\n        })\n        return false;\n      }\n      // 设置用户信息\n      this.setData({\n        userInfo: res.data.userInfo,\n        showLoginDialog: false\n      });\n      app.globalData.userInfo = res.data.userInfo;\n      app.globalData.token = res.data.token;\n      wx.setStorageSync('userInfo', JSON.stringify(res.data.userInfo));\n      wx.setStorageSync('token', res.data.token);\n    }).catch((err) => {\n      console.log(err)\n    })\n  },\n\n  onOrderInfoClick: function(event) {\n    wx.navigateTo({\n      url: '/pages/ucenter/order/order',\n    })\n  },\n\n  onSectionItemClick: function(event) {\n\n  },\n\n  // TODO 移到个人信息页面\n  exitLogin: function() {\n    wx.showModal({\n      title: '',\n      confirmColor: '#b4282d',\n      content: '退出登录？',\n      success: function(res) {\n        if (res.confirm) {\n          wx.removeStorageSync('token');\n          wx.removeStorageSync('userInfo');\n          wx.switchTab({\n            url: '/pages/index/index'\n          });\n        }\n      }\n    })\n\n  }\n})"
  },
  {
    "path": "pages/ucenter/index/index.json",
    "content": "{\n  \"navigationBarBackgroundColor\": \"#333\",\n  \"navigationBarTitleText\": \"我的\",\n  \"navigationBarTextStyle\": \"white\",\n  \"backgroundColor\": \"#f4f4f4\"\n}"
  },
  {
    "path": "pages/ucenter/index/index.wxml",
    "content": "<view class=\"container\">\n  <view class=\"profile-info\">\n    <image bindtap=\"onUserInfoClick\" class=\"avatar\" src=\"{{userInfo.avatar}}\"></image>\n    <view class=\"info\">\n      <text class='name' bindtap='onUserInfoClick'>{{ userInfo.nickname || '点击登录' }}</text>\n      <!-- <text class='level' bindtap='onUserInfoClick'></text> -->\n    </view>\n    <image bindtap=\"onUserInfoClick\" class='btn' src='/static/images/address_right.png'></image>\n  </view>\n\n  <view class=\"user-menu\">\n    <view class=\"item\">\n      <navigator url=\"/pages/ucenter/order/order\" class=\"a\">\n        <text class=\"icon order\"></text>\n        <text class=\"txt\">我的订单</text>\n      </navigator>\n    </view>\n    <view class=\"item\">\n      <navigator url=\"/pages/ucenter/coupon/coupon\" class=\"a\">\n        <text class=\"icon coupon\"></text>\n        <text class=\"txt\">优惠券</text>\n      </navigator>\n    </view>\n    <view class=\"item no-border\">\n      <navigator url=\"url\" class=\"a\">\n        <text class=\"icon gift\"></text>\n        <text class=\"txt\">礼品卡</text>\n      </navigator>\n    </view>\n    <view class=\"item\">\n      <navigator url=\"/pages/ucenter/collect/collect\" class=\"a\">\n        <text class=\"icon address\"></text>\n        <text class=\"txt\">我的收藏</text>\n      </navigator>\n    </view>\n    <view class=\"item\">\n      <navigator url=\"/pages/ucenter/footprint/footprint\" class=\"a\">\n        <text class=\"icon security\"></text>\n        <text class=\"txt\">我的足迹</text>\n      </navigator>\n    </view>\n    <view class=\"item no-border\">\n      <navigator url=\"url\" class=\"a\">\n        <text class=\"icon kefu\"></text>\n        <text class=\"txt\">会员福利</text>\n      </navigator>\n    </view>\n    <view class=\"item\">\n      <navigator url=\"../address/address\" class=\"a\">\n        <text class=\"icon address\"></text>\n        <text class=\"txt\">地址管理</text>\n      </navigator>\n    </view>\n    <view class=\"item\">\n      <navigator url=\"url\" class=\"a\">\n        <text class=\"icon security\"></text>\n        <text class=\"txt\">账号安全</text>\n      </navigator>\n    </view>\n    <view class=\"item no-border\">\n      <navigator url=\"url\" class=\"a\">\n        <text class=\"icon kefu\"></text>\n        <text class=\"txt\">联系客服</text>\n      </navigator>\n    </view>\n    <view class=\"item item-bottom\">\n      <navigator url=\"url\" class=\"a\">\n        <text class=\"icon help\"></text>\n        <text class=\"txt\">帮助中心</text>\n      </navigator>\n    </view>\n    <view class=\"item item-bottom\">\n      <navigator url=\"/pages/ucenter/feedback/feedback\" class=\"a\">\n        <text class=\"icon feedback\"></text>\n        <text class=\"txt\">意见反馈</text>\n      </navigator>\n    </view>\n  </view>\n\n  <!-- <view class=\"logout\" bindtap=\"exitLogin\">退出登录</view> -->\n</view>\n\n<view class='dialog-login' wx:if=\"{{showLoginDialog}}\" bindtap='onCloseLoginDialog'>\n  <view class='dialog-body' catchtap='onDialogBody'>\n    <view class='title'>请选择登录方式</view>\n    <view class='content'>\n      <button type=\"primary\" open-type=\"getUserInfo\" bindgetuserinfo=\"onWechatLogin\">微信登录</button>\n      <button open-type=\"getUserInfo\" lang=\"zh_CN\" bindgetuserinfo=\"onWechatLogin\">手机号登录</button>\n    </view>\n  </view>\n</view>"
  },
  {
    "path": "pages/ucenter/index/index.wxss",
    "content": "page{\n    height: 100%;\n    width: 100%;\n    background: #f4f4f4;\n}\n.container{\n    background: #f4f4f4;\n    height: auto;\n    overflow: hidden;\n    width: 100%;\n}\n.profile-info {\n  width: 100%;\n  height: 280rpx;\n  display: flex;\n  flex-wrap: wrap;\n  align-items: center;\n  justify-content: flex-start;\n  padding: 0 30.25rpx;\n  background: #333;\n}\n\n.profile-info .avatar {\n  height: 148rpx;\n  width: 148rpx;\n  border-radius: 50%;\n  border: 4rpx solid #fff;\n}\n\n.profile-info .info {\n  flex: 1;\n  height: 85rpx;\n  margin-left: 30rpx;\n  display: flex;\n  flex-direction: column;\n  justify-content: center;\n}\n\n.profile-info .name {\n  height: 45rpx;\n  line-height: 45rpx;\n  color: #fff;\n  font-size: 37.5rpx;\n}\n\n.profile-info .level {\n  height: 30rpx;\n  line-height: 30rpx;\n  margin-top: 10rpx;\n  color: #7f7f7f;\n  font-size: 30rpx;\n}\n\n.profile-info .btn {\n  width: 50rpx;\n  height: 50rpx;\n  margin-left: 10rpx;\n  border-radius: 50%;\n}\n\n.user-menu{\n    width: 100%;\n    height: auto;\n    overflow: hidden;\n    background: #fff;\n}\n\n.user-menu .item{\n    float: left;\n    width: 33.33333%;\n    height: 187.5rpx;\n    border-right: 1px solid rgba(0,0,0,.15);\n    border-bottom: 1px solid rgba(0,0,0,.15);\n    text-align: center;\n}\n\n.user-menu .item .a{\n  display: flex;\n  width: 100%;\n  height: 100%;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n}\n\n.user-menu .item.no-border {\n    border-right: 0;\n}\n\n.user-menu .item.item-bottom {\n    border-bottom: none;\n}\n\n.user-menu .icon{\n    margin: 0 auto;\n    display: block;\n    height: 52.803rpx;\n    width: 52.803rpx;\n    margin-bottom: 16rpx;\n}\n\n.user-menu .icon.order{\n    background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/ucenter-sdf6a55ee56-f2c2b9c2f0.png) 0 -437.5rpx no-repeat;\n    background-size: 52.803rpx;\n}\n\n.user-menu .icon.coupon{\n    background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/ucenter-sdf6a55ee56-f2c2b9c2f0.png) 0 -62.4997rpx no-repeat;\n    background-size: 52.803rpx;\n}\n\n.user-menu .icon.gift{\n    background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/ucenter-sdf6a55ee56-f2c2b9c2f0.png) 0 -187.5rpx no-repeat;\n    background-size: 52.803rpx;\n}\n\n.user-menu .icon.address{\n    background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/ucenter-sdf6a55ee56-f2c2b9c2f0.png) 0 0 no-repeat;\n    background-size: 52.803rpx;\n}\n\n.user-menu .icon.security{\n    background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/ucenter-sdf6a55ee56-f2c2b9c2f0.png) 0 -500rpx no-repeat;\n    background-size: 52.803rpx;\n}\n\n.user-menu .icon.kefu{\n    background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/ucenter-sdf6a55ee56-f2c2b9c2f0.png) 0 -312.5rpx no-repeat;\n    background-size: 52.803rpx;\n}\n\n.user-menu .icon.help{\n    background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/ucenter-sdf6a55ee56-f2c2b9c2f0.png) 0 -250rpx no-repeat;\n    background-size: 52.803rpx;\n}\n\n.user-menu .icon.feedback{\n    background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/ucenter-sdf6a55ee56-f2c2b9c2f0.png) 0 -125rpx no-repeat;\n    background-size: 52.803rpx;\n}\n\n\n.user-menu .txt{\n    display: block;\n    height: 24rpx;\n    width: 100%;\n    font-size: 24rpx;\n    color:#333;\n}\n\n.logout{\n    margin-top: 50rpx;\n    height: 101rpx;\n    width: 100%;\n    line-height: 101rpx;\n    text-align: center;\n    background: #fff;\n    color: #333;\n    font-size: 30rpx;\n}\n\n\n.dialog-login{\n  width: 100%;\n  height: 100%;\n  position: fixed;\n  top: 0;\n  left: 0;\n  background: rgba(0, 0, 0, 0.5); \n  display: flex;\n  justify-content: center;\n  align-items: center;\n}\n\n\n.dialog-login .dialog-body{\n  width: 540rpx;\n  height: auto;\n  overflow: hidden;\n  background: #fff;\n  border-radius: 5px;\n  padding: 40rpx;\n}\n\n.dialog-login .dialog-body .title{\n  width: 100%;\n  text-align: center;\n  line-height: 60rpx;\n}\n\n.dialog-login .dialog-body .content{\n  width: 100%;\n}\n\n.dialog-login .dialog-body button{\n  margin-top: 30rpx;\n}"
  },
  {
    "path": "pages/ucenter/order/order.js",
    "content": "var util = require('../../../utils/util.js');\nvar api = require('../../../config/api.js');\n\nPage({\n  data:{\n    orderList: []\n  },\n  onLoad:function(options){\n    // 页面初始化 options为页面跳转所带来的参数\n\n    this.getOrderList();\n  },\n  getOrderList(){\n    let that = this;\n    util.request(api.OrderList).then(function (res) {\n      if (res.errno === 0) {\n        console.log(res.data);\n        that.setData({\n          orderList: res.data.data\n        });\n      }\n    });\n  },\n  payOrder(){\n    wx.redirectTo({\n      url: '/pages/pay/pay',\n    })\n  },\n  onReady:function(){\n    // 页面渲染完成\n  },\n  onShow:function(){\n    // 页面显示\n  },\n  onHide:function(){\n    // 页面隐藏\n  },\n  onUnload:function(){\n    // 页面关闭\n  }\n})"
  },
  {
    "path": "pages/ucenter/order/order.json",
    "content": "{}"
  },
  {
    "path": "pages/ucenter/order/order.wxml",
    "content": "<view class=\"container\">\n    <view class=\"orders\">\n        <navigator url=\"../orderDetail/orderDetail?id={{item.id}}\" class=\"order\" wx:for=\"{{orderList}}\" wx:key=\"{{item.id}}\">\n            <view class=\"h\">\n                <view class=\"l\">订单编号：{{item.order_sn}}</view>\n                <view class=\"r\">{{item.order_status_text}}</view>\n            </view>\n            <view class=\"goods\" wx:for=\"{{item.goodsList}}\" wx:key=\"{{gitem.id}}\" wx:for-item=\"gitem\">\n                <view class=\"img\">\n                    <image src=\"{{gitem.list_pic_url}}\"></image>\n                </view>\n                <view class=\"info\">\n                    <text class=\"name\">{{gitem.goods_name}}</text>\n                    <text class=\"number\">共{{gitem.number}}件商品</text>\n                </view>\n                <view class=\"status\"></view>\n            </view>\n            <view class=\"b\">\n                <view class=\"l\">实付：￥{{item.actual_price}}</view>\n                <view class=\"r\">\n                    <button class=\"btn\" data-order-index=\"{{index}}\" catchtap=\"payOrder\" wx:if=\"{{item.handleOption.pay}}\">去付款</button>\n                </view>\n            </view>\n        </navigator>\n    </view>\n</view>\n"
  },
  {
    "path": "pages/ucenter/order/order.wxss",
    "content": "page{\n    height: 100%;\n    width: 100%;\n    background: #f4f4f4;\n}\n\n.orders{\n    height: auto;\n    width: 100%;\n    overflow: hidden;\n}\n\n.order{\n    margin-top: 20rpx;\n    background: #fff;\n}\n\n.order .h{\n    height: 83.3rpx;\n    line-height: 83.3rpx;\n    margin-left: 31.25rpx;\n    padding-right: 31.25rpx;\n    border-bottom: 1px solid #f4f4f4;\n    font-size: 30rpx;\n    color: #333;\n}\n\n.order .h .l{\n    float: left;\n}\n\n.order .h .r{\n    float: right;\n    color: #b4282d;\n    font-size: 24rpx;\n}\n\n.order .goods{\n    display: flex;\n    align-items: center;\n    height: 199rpx;\n    margin-left: 31.25rpx;\n}\n\n.order .goods .img{\n    height:145.83rpx;\n    width:145.83rpx;\n    background: #f4f4f4;\n}\n\n.order .goods .img image{\n    height:145.83rpx;\n    width:145.83rpx;\n}\n\n.order .goods .info{\n    height: 145.83rpx;\n    flex: 1;\n    padding-left: 20rpx;\n}\n\n.order .goods .name{\n    margin-top: 30rpx;\n    display: block;\n    height: 44rpx;\n    line-height: 44rpx;\n    color: #333;\n    font-size: 30rpx;\n}\n\n.order .goods .number{\n    display: block;\n    height: 37rpx;\n    line-height: 37rpx;\n    color: #666;\n    font-size: 25rpx;\n}\n\n.order .goods .status{\n    width:105rpx;\n    color: #b4282d;\n    font-size: 25rpx;\n}\n\n.order .b{\n    height: 103rpx;\n    line-height: 103rpx;\n    margin-left: 31.25rpx;\n    padding-right: 31.25rpx;\n    border-top: 1px solid #f4f4f4;\n    font-size: 30rpx;\n    color: #333;\n}\n\n.order .b .l{\n    float: left;\n}\n\n.order .b .r{\n    float: right;\n}\n\n.order .b .btn{\n    margin-top: 19rpx;\n    height: 64.5rpx;\n    line-height: 64.5rpx;\n    text-align: center;\n    padding: 0 20rpx;\n    border-radius: 5rpx;\n    font-size: 28rpx;\n    color: #fff;\n    background: #b4282d;\n}"
  },
  {
    "path": "pages/ucenter/orderDetail/orderDetail.js",
    "content": "var util = require('../../../utils/util.js');\nvar api = require('../../../config/api.js');\n\nPage({\n  data: {\n    orderId: 0,\n    orderInfo: {},\n    orderGoods: [],\n    handleOption: {}\n  },\n  onLoad: function (options) {\n    // 页面初始化 options为页面跳转所带来的参数\n    this.setData({\n      orderId: options.id\n    });\n    this.getOrderDetail();\n  },\n  getOrderDetail() {\n    let that = this;\n    util.request(api.OrderDetail, {\n      orderId: that.data.orderId\n    }).then(function (res) {\n      if (res.errno === 0) {\n        console.log(res.data);\n        that.setData({\n          orderInfo: res.data.orderInfo,\n          orderGoods: res.data.orderGoods,\n          handleOption: res.data.handleOption\n        });\n        //that.payTimer();\n      }\n    });\n  },\n  payTimer() {\n    let that = this;\n    let orderInfo = that.data.orderInfo;\n\n    setInterval(() => {\n      console.log(orderInfo);\n      orderInfo.add_time -= 1;\n      that.setData({\n        orderInfo: orderInfo,\n      });\n    }, 1000);\n  },\n  payOrder() {\n    let that = this;\n    util.request(api.PayPrepayId, {\n      orderId: that.data.orderId || 15\n    }).then(function (res) {\n      if (res.errno === 0) {\n        const payParam = res.data;\n        wx.requestPayment({\n          'timeStamp': payParam.timeStamp,\n          'nonceStr': payParam.nonceStr,\n          'package': payParam.package,\n          'signType': payParam.signType,\n          'paySign': payParam.paySign,\n          'success': function (res) {\n            console.log(res)\n          },\n          'fail': function (res) {\n            console.log(res)\n          }\n        });\n      }\n    });\n\n  },\n  onReady: function () {\n    // 页面渲染完成\n  },\n  onShow: function () {\n    // 页面显示\n  },\n  onHide: function () {\n    // 页面隐藏\n  },\n  onUnload: function () {\n    // 页面关闭\n  }\n})"
  },
  {
    "path": "pages/ucenter/orderDetail/orderDetail.json",
    "content": "{\n    \n}"
  },
  {
    "path": "pages/ucenter/orderDetail/orderDetail.wxml",
    "content": "<view class=\"container\">\n    <view class=\"order-info\">\n        <view class=\"item-a\">下单时间：{{orderInfo.add_time}}</view>\n        <view class=\"item-b\">订单编号：{{orderInfo.order_sn}}</view>\n        <view class=\"item-c\">\n            <view class=\"l\">实付：<text class=\"cost\">￥{{orderInfo.actual_price}}</text></view>\n            <view class=\"r\">\n                <view class=\"btn\" bindtap=\"cancelOrder\">取消订单</view>\n                <view class=\"btn active\" bindtap=\"payOrder\">去付款</view>\n            </view>\n        </view>\n    </view>\n\n    <view class=\"order-goods\">\n        <view class=\"h\">\n            <view class=\"label\">商品信息</view>\n            <view class=\"status\">{{orderInfo.order_status_text}}</view>\n        </view>\n        <view class=\"goods\">\n            <view class=\"item\" wx:for=\"{{orderGoods}}\" wx:key=\"{{item.id}}\">\n                <view class=\"img\">\n                    <image src=\"{{item.list_pic_url}}\"></image>\n                </view>\n                <view class=\"info\">\n                    <view class=\"t\">\n                        <text class=\"name\">{{item.goods_name}}</text>\n                        <text class=\"number\">x{{item.number}}</text>\n                    </view>\n                    <view class=\"attr\">{{item.goods_specifition_name_value}}</view>\n                    <view class=\"price\">￥{{item.retail_price}}</view>\n                </view>\n            </view>\n        </view>\n    </view>\n\n    <view class=\"order-bottom\">\n        <view class=\"address\">\n            <view class=\"t\">\n                <text class=\"name\">{{orderInfo.consignee}}</text>\n                <text class=\"mobile\">{{orderInfo.mobile}}</text>\n            </view>\n            <view class=\"b\">{{orderInfo.full_region + orderInfo.address}}</view>\n        </view>\n        <view class=\"total\">\n            <view class=\"t\">\n                <text class=\"label\">商品合计：</text>\n                <text class=\"txt\">￥{{orderInfo.goods_price}}</text>\n            </view>\n            <view class=\"t\">\n                <text class=\"label\">运费：</text>\n                <text class=\"txt\">￥{{orderInfo.freight_price}}</text>\n            </view>\n        </view>\n        <view class=\"pay-fee\">\n            <text class=\"label\">实付：</text>\n            <text class=\"txt\">￥{{orderInfo.actual_price}}</text>\n        </view>\n    </view>\n</view>"
  },
  {
    "path": "pages/ucenter/orderDetail/orderDetail.wxss",
    "content": "page{\n    height: 100%;\n    width: 100%;\n    background: #f4f4f4;\n}\n\n.order-info{\n    padding-top: 25rpx;\n    background: #fff;\n    height: auto;\n    overflow: hidden;\n}\n\n.item-a{\n    padding-left: 31.25rpx;\n    height: 42.5rpx;\n    padding-bottom: 12.5rpx;\n    line-height: 30rpx;\n    font-size: 30rpx;\n    color: #666;\n}\n\n.item-b{\n    padding-left: 31.25rpx;\n    height: 29rpx;\n    line-height: 29rpx;\n    margin-top: 12.5rpx;\n    margin-bottom: 41.5rpx;\n    font-size: 30rpx;\n    color: #666;\n}\n\n.item-c{\n    margin-left: 31.25rpx;\n    border-top: 1px solid #f4f4f4;\n    height: 103rpx;\n    line-height: 103rpx;\n}\n\n.item-c .l{\n    float: left;\n}\n\n.item-c .r{\n    height: 103rpx;\n    float: right;\n    display: flex;\n    align-items: center;\n    padding-right: 16rpx;\n}\n\n.item-c .r .btn{\n    float: right;\n}\n\n.item-c .cost{\n    color: #b4282d;\n}\n\n.item-c .btn{\n    line-height: 66rpx;\n    border-radius: 5rpx;\n    text-align: center;\n    margin: 0 15rpx;\n    padding: 0 20rpx;\n    height: 66rpx;\n}\n\n.item-c .btn.active{\n    background: #b4282d;\n    color: #fff;\n}\n\n.order-goods{\n    margin-top: 20rpx;\n    background: #fff;\n}\n\n.order-goods .h{\n    height: 93.75rpx;\n    line-height: 93.75rpx;\n    margin-left: 31.25rpx;\n    border-bottom: 1px solid #f4f4f4;\n    padding-right: 31.25rpx;\n}\n\n.order-goods .h .label{\n    float: left;\n    font-size: 30rpx;\n    color: #333;\n}\n\n.order-goods .h .status{\n    float: right;\n    font-size: 30rpx;\n    color: #b4282d;\n}\n\n.order-goods .item{\n    display: flex;\n    align-items: center;\n    height: 192rpx;\n    margin-left: 31.25rpx;\n    padding-right: 31.25rpx;\n    border-bottom: 1px solid #f4f4f4;\n}\n\n.order-goods .item:last-child{\n    border-bottom: none;\n}\n\n.order-goods .item .img{\n    height: 145.83rpx;\n    width: 145.83rpx;\n    background: #f4f4f4;\n}\n\n.order-goods .item .img image{\n    height: 145.83rpx;\n    width: 145.83rpx;\n}\n\n.order-goods .item .info{\n    flex: 1;\n    height: 145.83rpx;\n    margin-left: 20rpx;\n}\n\n.order-goods .item .t{\n    margin-top: 8rpx;\n    height: 33rpx;\n    line-height: 33rpx;\n    margin-bottom: 10.5rpx;\n}\n\n.order-goods .item .t .name{\n    display: block;\n    float: left;\n    height: 33rpx;\n    line-height: 33rpx;\n    color: #333;\n    font-size: 30rpx;\n}\n\n.order-goods .item .t .number{\n    display: block;\n    float: right;\n    height: 33rpx;\n    text-align: right;\n    line-height: 33rpx;\n    color: #333;\n    font-size: 30rpx;\n}\n\n.order-goods .item .attr{\n    height: 29rpx;\n    line-height: 29rpx;\n    color: #666;\n    margin-bottom: 25rpx;\n    font-size: 25rpx;\n}\n\n.order-goods .item .price{\n    height: 30rpx;\n    line-height: 30rpx;\n    color: #333;\n    font-size: 30rpx;\n}\n\n.order-bottom{\n    margin-top: 20rpx;\n    padding-left: 31.25rpx;\n    height: auto;\n    overflow: hidden;\n    background: #fff;\n}\n\n.order-bottom .address{\n    height: 128rpx;\n    padding-top: 25rpx;\n    border-bottom: 1px solid #f4f4f4;\n}\n\n.order-bottom .address .t{\n    height: 35rpx;\n    line-height: 35rpx;\n    margin-bottom: 7.5rpx;\n}\n\n.order-bottom .address .name{\n    display: inline-block;\n    height: 35rpx;\n    width: 140rpx;\n    line-height: 35rpx;\n    font-size: 25rpx;\n}\n\n.order-bottom .address .mobile{\n    display: inline-block;\n    height: 35rpx;\n    line-height: 35rpx;\n    font-size: 25rpx;\n}\n\n.order-bottom .address .b{\n    height: 35rpx;\n    line-height: 35rpx;\n    font-size: 25rpx;\n}\n\n.order-bottom .total{\n    height: 106rpx;\n    padding-top: 20rpx;\n    border-bottom: 1px solid #f4f4f4;\n}\n\n.order-bottom .total .t{\n    height: 25rpx;\n    line-height: 25rpx;\n    margin-bottom: 7.5rpx;\n    display: flex;\n}\n\n.order-bottom .total .label{\n    width: 140rpx;\n    display: inline-block;\n    height: 35rpx;\n    line-height: 35rpx;\n    font-size: 25rpx;\n}\n\n.order-bottom .total .txt{\n    flex: 1;\n    display: inline-block;\n    height: 35rpx;\n    line-height: 35rpx;\n    font-size: 25rpx;\n}\n\n.order-bottom .pay-fee{\n    height: 81rpx;\n    line-height: 81rpx;\n}\n\n.order-bottom .pay-fee .label{\n    display: inline-block;\n    width: 140rpx;\n    color: #b4282d;\n}\n\n.order-bottom .pay-fee .txt{\n    display: inline-block;\n    width: 140rpx;\n    color: #b4282d;\n}"
  },
  {
    "path": "services/pay.js",
    "content": "/**\n * 支付相关服务\n */\n\nconst util = require('../utils/util.js');\nconst api = require('../config/api.js');\n\n/**\n * 判断用户是否登录\n */\nfunction payOrder(orderId) {\n  return new Promise(function (resolve, reject) {\n    util.request(api.PayPrepayId, {\n      orderId: orderId\n    }).then((res) => {\n      console.log(res)\n      if (res.errno === 0) {\n        const payParam = res.data;\n        wx.requestPayment({\n          'timeStamp': payParam.timeStamp,\n          'nonceStr': payParam.nonceStr,\n          'package': payParam.package,\n          'signType': payParam.signType,\n          'paySign': payParam.paySign,\n          'success': function (res) {\n            resolve(res);\n          },\n          'fail': function (res) {\n            reject(res);\n          },\n          'complete': function (res) {\n            reject(res);\n          }\n        });\n      } else {\n        reject(res);\n      }\n    });\n  });\n}\n\n\nmodule.exports = {\n  payOrder,\n};\n\n\n\n\n\n\n\n\n\n\n\n"
  },
  {
    "path": "services/user.js",
    "content": "/**\n * 用户相关服务\n */\n\nconst util = require('../utils/util.js');\nconst api = require('../config/api.js');\n\n\n/**\n * 调用微信登录\n */\nfunction loginByWeixin() {\n\n  let code = null;\n  return new Promise(function (resolve, reject) {\n    return util.login().then((res) => {\n      code = res.code;\n      return util.getUserInfo();\n    }).then((userInfo) => {\n      //登录远程服务器\n      util.request(api.AuthLoginByWeixin, { code: code, userInfo: userInfo }, 'POST').then(res => {\n        if (res.errno === 0) {\n          //存储用户信息\n          wx.setStorageSync('userInfo', res.data.userInfo);\n          wx.setStorageSync('token', res.data.token);\n\n          resolve(res);\n        } else {\n          reject(res);\n        }\n      }).catch((err) => {\n        reject(err);\n      });\n    }).catch((err) => {\n      reject(err);\n    })\n  });\n}\n\n/**\n * 判断用户是否登录\n */\nfunction checkLogin() {\n  return new Promise(function (resolve, reject) {\n    if (wx.getStorageSync('userInfo') && wx.getStorageSync('token')) {\n\n      util.checkSession().then(() => {\n        resolve(true);\n      }).catch(() => {\n        reject(false);\n      });\n\n    } else {\n      reject(false);\n    }\n  });\n}\n\n\nmodule.exports = {\n  loginByWeixin,\n  checkLogin,\n};\n\n\n\n\n\n\n\n\n\n\n\n"
  },
  {
    "path": "utils/util.js",
    "content": "var api = require('../config/api.js')\n\nfunction formatTime(date) {\n  var year = date.getFullYear()\n  var month = date.getMonth() + 1\n  var day = date.getDate()\n\n  var hour = date.getHours()\n  var minute = date.getMinutes()\n  var second = date.getSeconds()\n\n\n  return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':')\n}\n\nfunction formatNumber(n) {\n  n = n.toString()\n  return n[1] ? n : '0' + n\n}\n\n/**\n * 封封微信的的request\n */\nfunction request(url, data = {}, method = \"GET\") {\n  return new Promise(function (resolve, reject) {\n    wx.request({\n      url: url,\n      data: data,\n      method: method,\n      header: {\n        'Content-Type': 'application/json',\n        'X-Nideshop-Token': wx.getStorageSync('token')\n      },\n      success: function (res) {\n        console.log(\"success\");\n\n        if (res.statusCode == 200) {\n\n          if (res.data.errno == 401) {\n            //需要登录后才可以操作\n\n            let code = null;\n            return login().then((res) => {\n              code = res.code;\n              return getUserInfo();\n            }).then((userInfo) => {\n              //登录远程服务器\n              request(api.AuthLoginByWeixin, { code: code, userInfo: userInfo }, 'POST').then(res => {\n                if (res.errno === 0) {\n                  //存储用户信息\n                  wx.setStorageSync('userInfo', res.data.userInfo);\n                  wx.setStorageSync('token', res.data.token);\n\n                  resolve(res);\n                } else {\n                  reject(res);\n                }\n              }).catch((err) => {\n                reject(err);\n              });\n            }).catch((err) => {\n              reject(err);\n            })\n          } else {\n            resolve(res.data);\n          }\n        } else {\n          reject(res.errMsg);\n        }\n\n      },\n      fail: function (err) {\n        reject(err)\n        console.log(\"failed\")\n      }\n    })\n  });\n}\n\nfunction get(url, data = {}) {\n  return request(url, data, 'GET')\n}\n\nfunction post(url, data = {}) {\n  return request(url, data, 'POST')\n}\n\n/**\n * 检查微信会话是否过期\n */\nfunction checkSession() {\n  return new Promise(function (resolve, reject) {\n    wx.checkSession({\n      success: function () {\n        resolve(true);\n      },\n      fail: function () {\n        reject(false);\n      }\n    })\n  });\n}\n\n/**\n * 调用微信登录\n */\nfunction login() {\n  return new Promise(function (resolve, reject) {\n    wx.login({\n      success: function (res) {\n        if (res.code) {\n          resolve(res.code);\n        } else {\n          reject(res);\n        }\n      },\n      fail: function (err) {\n        reject(err);\n      }\n    });\n  });\n}\n\nfunction getUserInfo() {\n  return new Promise(function (resolve, reject) {\n    wx.getUserInfo({\n      withCredentials: true,\n      success: function (res) {\n        if (res.detail.errMsg === 'getUserInfo:ok') {\n          resolve(res);\n        } else {\n          reject(res)\n        }\n      },\n      fail: function (err) {\n        reject(err);\n      }\n    })\n  });\n}\n\nfunction redirect(url) {\n\n  //判断页面是否需要登录\n  if (false) {\n    wx.redirectTo({\n      url: '/pages/auth/login/login'\n    });\n    return false;\n  } else {\n    wx.redirectTo({\n      url: url\n    });\n  }\n}\n\nfunction showErrorToast(msg) {\n  wx.showToast({\n    title: msg,\n    image: '/static/images/icon_error.png'\n  })\n}\n\nmodule.exports = {\n  formatTime,\n  request,\n  get,\n  post,\n  redirect,\n  showErrorToast,\n  checkSession,\n  login,\n  getUserInfo,\n}\n\n\n"
  }
]