使用imag.js开发过很多类型的模板,比如新闻、社交、办公类等,今天和大家分享如何开发电商类的app

电商类app的基本功能

商品商城首页、商品画面展示、商品信息录入(展示图片录入)、客户评价(商品图片录入)、会员中心(联系我们)、后台信息录入

 

电商平台开发架构 电商平台的开发流程_开发技巧

电商类app制作流程一般分为七步:

1、明确表达和确立企业需求

2、需求评估

3、项目技术开发与视觉规划

4、程序开发

5、测试

6、交付上线

7、维护与版本升级

 

我们主要讲一下第四步程序开发

 

以下图为例,页面可分为四大部分

 

电商平台开发架构 电商平台的开发流程_爱码哥_02

1、标题栏

第一部分的标题栏使用原生控件title标签,和HTML中的title不同的是他有且仅有三个子标签分别是<left><center><right>,第一部分可以划分为三个小模块扫码按钮、搜索框和消息按钮分别对应title的三个子标签 

<title style="background:#ffffff;padding:10 13">
    <left>
        <button οnclick="" style="background:sweep.png;height:20;width:20"></button>
    </left>      
    <center>
        <input type="search" placeholder="在众多App开发中选择iMAG"
        style="tint-color:#ffffff;background:#e6e6e6;color:#323232;width:281;font-size:10;corner-radius:5"/>        
    </center>
    <right>
        <button οnclick="" style="background:message.png;height:20;width:20"></button>
    </right>
</title>



在left子标签添加扫码的脚本功能——$phone.barcode()

 

2、顶部标签栏

顶部标签栏tabbar需要写在header标签里,通过多个item来切换不同的页面

<header>
    <tabbar style="background:#ffffff;label-color:#717171,#303030;indicator-color:#d80b08">
        <item label="推荐"></item>
        <item label="精选"></item>
        <item label="国内"></item>
        <item label="海淘"></item>
        <item label="母婴"></item>
        <item label="美妆"></item>
    </tabbar>
</header>



3、内容展示

内容展示部分大多数情况下都会使用list标签进行布局,需要跳转页面的可以在标签内添加onclick点击事件属性。

<contents>
    <content style="background:#FFFAFA">
        <slideimage style="height:186" indicatorPosition="right" fillwidth="true" autoplay="true">
            <item src="http://img1.efu.com.cn/upfile/bdvt/m-3d97ae02-1f65-463e-a0ad-cf1a39013135.png"/>
            <item src="http://img1.efu.com.cn/upfile/bdvt/m-7034ba7b-1177-4173-ad7a-4755957ef15a.jpg"/>
        </slideimage>
        <list style="height:55" type="transparent">
            <item style="padding:12 26 9">
                <col>
                    <row style="background:signin.png;height:17;width:17"></row>
                    <row><label style="font-size:11;align:center;color:#5c5c5c;padding-top:3">今日签到</label></row>
                </col>
                <col>
                    <row style="background:update.png;height:17;width:17"></row>
                    <row><label style="font-size:11;align:center;color:#5c5c5c;padding-top:3">每日上新</label></row>
                </col>
                <col>
                    <row style="background:shoplimit.png;height:17;width:17"></row>
                    <row><label style="font-size:11;align:center;color:#5c5c5c;padding-top:3">限时抢购</label></row>
                </col>
                <col>
                    <row style="background:discount.png;height:17;width:17"></row>
                    <row><label style="font-size:11;align:center;color:#5c5c5c;padding-top:3">推荐有礼</label></row>
                </col>
            </item>
        </list>
    </content>
</contents>

4、底部标签页

底部标签页切换不同的页面是tab标签实现的,tab标签很简单,只要把title和content等控件放到tab里面就可以了。

 

其他页面大家想要用什么样的布局方式都可以尝试一下,这里就不一一细讲了。       

 

电商平台开发架构 电商平台的开发流程_ide_03


详细代码可以在github上查看