开放新营销功能组件
该功能属于「基础库 3.0」
文件更新:
- Templates/product.html
- Templates/discount.html
- Templates/system/404.html
功能特点:
- 支持商品新营销功能。
相关说明:
- 修改位置可参考「藤煤竹」主题相关代码;
- 暂时只开放部分事件(相关说明):- SkProductInfo.created/- (vm)
- SkProductInfo.mounted/- (vm)
- SkProductInfo.updated/- (vm)
- SkProductInfo.variant.changed/- (currentVariant)
 
- 修改组件样式,请查看相关说明。
修改 Templates/product.html
引入 SkProductInfo 组件
替换 Class.pro-detail-cnt内的代码为<x-component is="sk-product-info"></x-component>
<div class="pro-detail-cnt">
  <x-component is="sk-product-info"></x-component>
  <!-- 基础库 3.0 会将`<x-component>`元素初始化为`is`属性所指定的组件 -->
</div>
引入 SkProductInfoPintuanJoin 组件
在 Class.pro-detail-inner同级下方添加<x-component is="sk-product-info-pintuan-join"></x-component>
修改 Templates/discount.html
将原有代码插入以下指定位置:
{% if discount.handle %}
<!-- 原有代码插入位置 -->
{% else %}
<div class="wrapper i-base">
  <div class="cont">
    <div class="mod">
      <x-component is="sk-discount"></x-component>
      <!-- 基础库 3.0 会将`<x-component>`元素初始化为`is`属性所指定的组件 -->
    </div>
  </div>
</div>
{% endif %}
修改 Templates/system/404.html
将原有代码替换成以下代码:
<div class="wrapper i-base">
  <div class="cont">
    <div class="mod">
      <x-component is="theme-base"></x-component>
      <!-- 基础库 3.0 会将`<x-component>`元素初始化为`is`属性所指定的组件;ThemeBase 组件有路由功能,会根据 URL 显示不同路由下的内容 -->
    </div>
  </div>
</div>
PS: <x-component>外层包裹的元素和主题布局有关,开发者根据主题情况可以去掉自己做调整。
简单测试用例
- 相关修改文件 JS 代码运行不报错;
- 登录和注册流程正常;
- 免登陆购买流程正常;
- 无登录购买流程正常(添加购物车 > 提交购物车 > 跳转登录 > 登录后跳转提交订单页 > 提交订单成功 > 支付成功 > 订单详情页);
- 营销功能正常;- 若无测试条件可以联系友好速搭技术指导(若条件允许,将安排相关人员帮忙测试)。
 
 
 
 
