登录 用户中心() [退出] 后台管理 注册
   
您的位置: 首页 >> SoftHub关联区 >> 主题: 商品内容,帖子内容//微信小程序专用接口     [回主站]     [分站链接]
商品内容,帖子内容//微信小程序专用接口
clq
浏览(3) - 2018-08-26 13:59:20 发表 编辑

关键字:

[2021-11-17 18:42:53 最后更新]


ccc 2018/8/23 11:25:30
    //商品内容,帖子内容//微信小程序专用接口
    //注意和 index.php?m=home&c=admin&a=ajax_get_topic_field 的功能一样,不过处理更多一点
    //public function goodsContent()
    //微信小程序中还要对图片//网页中的图片加上域名
    //common.wxParseAddFullImageUrl(that, 'content');
    //这个步骤应该也可以放在后台
    //小程序中有一个非常巧妙的 page.data[] 可以将字符串转换成 dom 处理更方便
    public function topicContent()
    {
        $is_json = I('is_json', 0);
        //$goods_id = I("get.id/d" , 0);
        $goods_id = $_REQUEST['id'];
        
        //$goods = M('Goods')->field('goods_content')->where("goods_id" , $goods_id)->find();
        $goods = M('topic')->field('topic_memo')->where("id" , $goods_id)->find();
        if(empty($goods)){
            $this->error('此商品不存在或者已下架');
        }

//        $goods_attribute = M('GoodsAttribute')->getField('attr_id,attr_name'); // 查询属性
//        $goods_attr_list = M('GoodsAttr')->where("goods_id" , $goods_id)->select(); // 查询商品属性表                        

//        if ($is_json) {
            //foreach ($goods_attr_list as &$attr) {
            //    $attr['attr_name'] = $goods_attribute[$attr['attr_id']];
            //}
            ////$this->ajaxReturn(['status'=>1,'msg'=>'获取成功', 'result' => [
            ajaxReturn(['status'=>1,'msg'=>'获取成功', 'result' => [
                //'goods_content' => $goods['goods_content'],
                'goods_content' => $goods['topic_memo'],
                'goods_attr_list' => $goods_attr_list,
            ]]);
//        }
        
//        $this->assign('goods_attribute',$goods_attribute);//属性值     
//        $this->assign('goods_attr_list',$goods_attr_list);//属性列表
//        $this->assign('goods',$goods);
//        return $this->fetch();
    }//   




---------------------------------------------------
    //网页中的图片加上域名
    wxParseAddFullImageUrl: function (page, contentStr) {
        if (typeof page.data[contentStr].images != 'undefined') {
            var content = page.data[contentStr];
            for (var i = 0; i < content.images.length; i++) {
                content.images[i].attr.src = this.getFullUrl(content.images[i].attr.src);
                content.imageUrls[i] = this.getFullUrl(content.imageUrls[i]);
            }
            console.log(content);
            page.setData({ [contentStr]: content });
        }
    },


-----------------------------------------------
    getFullUrl: function (url) {
        if (!url || url.indexOf('http') == 0 || url.indexOf('www') == 0) {
            return url;
        }
        //clq 2018//return this.app().globalData.setting.url + url;
//return this.app().globalData.setting.site_url + url; //this.app().globalData.setting.url 可能带有 index.php 这样的,所以换一个变量名
//图片用到上面的路径时仍然不对,因为百度编辑器这样的图片路径是相对于整个站点的
return this.app().globalData.setting.site_url_root + url;
    },








ccc 2018/8/24 14:50:36
<view style='width:100%; height:390rpx;'><!-- //clq 2018 add 为了把探索框放到轮播图上而已 -->
<!--轮播图-->
<view class="swiper_box">
    <swiper indicator-dots="true" vertical="" autoplay="true" interval="3000" duration="1000">
        <block wx:for="{{homeData.ad}}" wx:key="index">
            <swiper-item>
                <navigator url="{{item.ad_link}}">
                  <!-- aaa --><image mode="aspectFill" src="{{item.ad_code}}"/>
                </navigator>
            </swiper-item>
        </block>
    </swiper>
</view>
<!--搜索栏-->
<view class="search-box" style='position:relative; top:-380rpx;' >
    <view class="search-inner" style='background-color:#888; border-width:0px; padding:12rpx;'>
        <input style='background-color:#888; color:#fff; text-align:center;' class="search-cont" placeholder-class="phcolor" placeholder="楼盘名称/地产商" type="text" bindfocus="jumpSearch"/>
        <view class="search-img">
            <image mode="aspectFit" src="../../../images/search.png"></image>
        </view>
    </view>
</view>
https://blog.csdn.net/xiaochun365/article/details/70182501    微信小程序 相对定位和绝对定位
ccc 2018/8/24 14:52:37
https://blog.csdn.net/qq_32067045/article/details/53924536
ccc 2018/8/24 15:06:57
/* .search-box{width: 100%;height:auto;display: flex;background: #ffffff;} //clq 2018 不要 background 就透明了 opacity 没用,子 view 不能修改 */
.search-box{width: 100%;height:auto;display: flex;}
ccc 2018/8/24 15:13:48
.search-box{width: 100%;height:auto;display: flex;background: #ffffff;} /* //clq 2018 不要 background 就透明了 opacity 没用,子 view 不能修改,或者行内 css 加上 background-color:transparent; */
/* .search-box{width: 100%;height:auto;display: flex;} */
ccc 2018/8/24 15:54:55
背景图片自适应大小(css3)
2017年07月27日 13:22:10 阅读数:4012 标签: 前端

一个做后台的让写h5前端页面,这不是开国际玩笑吗,还好百度,代码贴出来

body {

            background: url(/happytime/img/index.jpg) no-repeat center center fixed; 


            background-size: 100%;//此处要注意,可以填cover也可以填100%。建议填100%

        }

 备注:折腾了俩个多小时,才解决一个bug,就在上面标注的那个需注意的地方。background-size是一个CSS3属性。原本设的置是cover,图片会填充屏幕。但是发现在360极速浏览器下左边会有1像素的白边。按照W3CShool给的值就三种:cover,contain,auto。其实这里可以填像素也可以填百分比。按理说百分比和cover是一个效果,但是在360极速浏览器里,就是差了那么一两个像素,别的浏览器都没问题。

其实准确的说是只有在360极速浏览器的极速模式里才有这个问题。

background-size的两个可选值的含义:contain是让背景图片恰好显示在容器中,图片的外边缘“顶着”容器的内边缘;而cover是覆盖容器,容器的外边缘“顶着”图片的内边缘。


另外,center是让图片居中定位,让图片的中部位于浏览器的中部。fixed使得背景不会跟随滚动条移动。
ccc 2018/8/24 16:21:47
<!-- //clq 2018 不行,小程序的 background-image 本地图片只能在高度器中显示,实际运行是不显示的,本地图片目前一定要用 image 标签 -->
<view style="height:90px; width:100%; background-color: #ffffff;border-bottom: 1rpx solid #ddd; border-left: 1rpx solid #ddd; display:inline-block; margin1:2px; box-sizing: border-box; background-image: url('/images/2018/nx.png'); background-repeat:no-repeat; background-size:100% ;-moz-background-size:100%;">
<view>楼盘类型</view>
<view style="font-size: 24rpx; color:#aaa;">多种房源任你选</view>
</view>



总数:0 页次:1/0 首页 尾页  
总数:0 页次:1/0 首页 尾页  


所在合集/目录



发表评论:
文本/html模式切换 插入图片 文本/html模式切换


附件:



NEWBT官方QQ群1: 276678893
可求档连环画,漫画;询问文本处理大师等软件使用技巧;求档softhub软件下载及使用技巧.
但不可"开车",严禁国家敏感话题,不可求档涉及版权的文档软件.
验证问题说明申请入群原因即可.

Copyright © 2005-2020 clq, All Rights Reserved
版权所有
桂ICP备15002303号-1