Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions example/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { featureProbeClient, FPUser} from "featureprobe-client-sdk-miniprogram";
// app.js
App({
onLaunch() {
const user = new FPUser();
user.with("userId", "1234567890");

//注意将域名添加为可信或关掉域名校验
featureProbeClient.init({
remoteUrl: "https://featureprobe.io/server",
clientSdkKey: "client-25614c7e03e9cb49c0e96357b797b1e47e7f2dff",
user,
refreshInterval: 5000,
});

featureProbeClient.start();
},
globalData: {
userInfo: null
}
})
14 changes: 14 additions & 0 deletions example/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"pages":[
"pages/index/index",
"pages/another/another"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "Weixin",
"navigationBarTextStyle":"black"
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}
1 change: 1 addition & 0 deletions example/app.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/**app.wxss**/
15 changes: 15 additions & 0 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "featureprobe-client-sdk-miniprogram",
"version": "1.0.0",
"description": "",
"main": ".eslintrc.js",
"dependencies": {
"featureprobe-client-sdk-miniprogram": "^1.0.0"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
17 changes: 17 additions & 0 deletions example/pages/another/another.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// another.js

const app = getApp();

Page({
data: {
boolValue: '',
boolDetail: ''
},

onLoad() {
this.setData({
boolValue: JSON.stringify(app.globalData.toggles['campaign_allow_list'].value),
boolDetail: JSON.stringify(app.globalData.toggles['campaign_allow_list'])
})
}
})
4 changes: 4 additions & 0 deletions example/pages/another/another.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "another",
"usingComponents": {}
}
16 changes: 16 additions & 0 deletions example/pages/another/another.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!--index.wxml-->
<view class="container">
<view class="h2">FeatureProbe miniprogram SDK demo</view>
<view>
This is a simple WeChat Mini Program Application using FeatureProbe Mini Program SDK.
</view>

<view class="h3">boolean type</view>
<view>
FeatureProbe evaluation boolean type toggle result is : {{boolValue}}
</view>
<view>
FeatureProbe evaluation boolean type toggle detail is :
<view>{{boolDetail}}</view>
</view>
</view>
32 changes: 32 additions & 0 deletions example/pages/another/another.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**index.wxss**/
.container {
margin: 0 16rpx;
text-align: start;
padding: 0 0 150rpx;
}

.h2 {
display: block;
font-size: 1.5em;
margin-block-start: 0.83em;
margin-block-end: 0.83em;
margin-inline-start: 0px;
margin-inline-end: 0px;
font-weight: bold;
width: 100%;
}

.h3 {
display: block;
font-size: 1.17em;
margin-block-start: 1em;
margin-block-end: 1em;
margin-inline-start: 0px;
margin-inline-end: 0px;
font-weight: bold;
width: 100%;
}

view {
word-break: break-all;
}
27 changes: 27 additions & 0 deletions example/pages/index/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { featureProbeClient } from "featureprobe-client-sdk-miniprogram";
// index.js

Page({
data: {

},

onLoad() {
const _this = this;
featureProbeClient.on('ready', function () {
const boolValue = featureProbeClient.boolValue("campaign_allow_list", false);
const boolDetail = featureProbeClient.boolDetail("campaign_allow_list", false);

_this.setData({
boolValue: JSON.stringify(boolValue),
boolDetail: JSON.stringify(boolDetail),
});
})
},

onreplace() {
wx.navigateTo({
url: '/pages/another/another',
});
}
})
4 changes: 4 additions & 0 deletions example/pages/index/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "index",
"usingComponents": {}
}
19 changes: 19 additions & 0 deletions example/pages/index/index.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!--index.wxml-->
<view class="container">
<view class="h2">FeatureProbe miniprogram SDK demo</view>
<view>
This is a simple WeChat Mini Program Application using FeatureProbe Mini Program SDK.
</view>

<view class="h3">boolean type</view>
<view>
FeatureProbe evaluation boolean type toggle result is : {{boolValue}}
</view>
<view>
FeatureProbe evaluation boolean type toggle detail is :
<view>{{boolDetail}}</view>
</view>
<view class="link-box">
<text class="link" type="primary" bindtap="onreplace">another page ></text>
</view>
</view>
43 changes: 43 additions & 0 deletions example/pages/index/index.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**index.wxss**/
.container {
margin: 0 16rpx;
text-align: start;
padding: 0 0 150rpx;
}

.h2 {
display: block;
font-size: 1.5em;
margin-block-start: 0.83em;
margin-block-end: 0.83em;
margin-inline-start: 0px;
margin-inline-end: 0px;
font-weight: bold;
width: 100%;
}

.h3 {
display: block;
font-size: 1.17em;
margin-block-start: 1em;
margin-block-end: 1em;
margin-inline-start: 0px;
margin-inline-end: 0px;
font-weight: bold;
width: 100%;
}

.link-box {
display: flex;
justify-content: flex-end;
margin: 30rpx 0;
}

view {
word-break: break-all;
}

.link {
color: #1054e7;
text-align: end;
}
51 changes: 51 additions & 0 deletions example/project.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"description": "项目配置文件",
"packOptions": {
"ignore": [],
"include": []
},
"setting": {
"bundle": false,
"userConfirmedBundleSwitch": false,
"urlCheck": true,
"scopeDataCheck": false,
"coverView": true,
"es6": true,
"postcss": true,
"compileHotReLoad": false,
"lazyloadPlaceholderEnable": false,
"preloadBackgroundData": false,
"minified": true,
"autoAudits": false,
"newFeature": false,
"uglifyFileName": false,
"uploadWithSourceMap": true,
"useIsolateContext": true,
"nodeModules": false,
"enhance": true,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"showShadowRootInWxmlPanel": true,
"packNpmManually": false,
"enableEngineNative": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"showES6CompileOption": false,
"minifyWXML": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"compileType": "miniprogram",
"libVersion": "2.19.4",
"appid": "wx93b45ca8d4ca664a",
"projectname": "miniprogram-92",
"condition": {},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
}
}
8 changes: 8 additions & 0 deletions example/project.private.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "feature-probe-miniprogram-sdk-demo",
"setting": {
"compileHotReLoad": true,
"urlCheck": false
}
}
7 changes: 7 additions & 0 deletions example/sitemap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{
"action": "allow",
"page": "*"
}]
}